今天試了一下用WH_KEYBOARD_LL但只能屏蔽<Alt>+<Tab>不能弄掉<Ctrl>+<Alt>+<Del>
是拷貝以前麻子的代碼,只是換個消息罷了,下面是麻子原來的代碼:
在離線庫中搜的
来自: 刘麻子, 时间: 2004-04-23 20:52:27, ID: 2576497
普通钩子
=============================动态连接库代码
library DllP;
uses windows;
procedure HookOn;stdcall;
procedure HookOff;stdcall;
var
HookH:HHook; //钩子句柄
function keyhook(Code:Integer;wParam:WPARAM;lParam:LPARAM):LRESULT;stdcall;
begin
Result:=1; //强行 屏蔽
end;
procedure HookOn;
begin
//把WH_KEYBOARD換成 WH_KEYBOARD_LL就可以弄掉<Alt>+<Tab>
HooKH:=SetWindowsHookEx(WH_KEYBOARD,keyHook,HInstance,0);
end;
procedure HookOff;
begin
UnHookWindowsHookEx(HookH);
end;
exports
HookOn,HookOff;
begin
end.
============================在exe中这样:
procedure HookOn ; stdcall; external 'DllP.dll';
procedure HookOff ; stdcall; external 'DllP.dll';
hookon; //挂键盘钩子