1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45:
| library Blocker;
uses WinTypes, WinProcs, Messages, Dialogs, SysUtils;
var HookHandle, MouseHandle: HHOOK;
function KeyHook(Code: integer; WParam: word; lParam: Longint): Longint; stdcall; begin Result:= CallNextHookEx(HookHandle, Code, 0, 0); end;
function MouseHook(Code: integer; WParam: word; lParam: Longint): Longint; stdcall; begin Result:= CallNextHookEx(MouseHandle, Code, 0, 0); end;
procedure SetKeyHook; export; begin HookHandle:=SetWindowsHookEx(WH_KEYBOARD, @KeyHook, hInstance, 0); MouseHandle:=SetWindowsHookEx(WH_MOUSE, @MouseHook, hInstance, 0); end;
procedure DelKeyHook; export; begin if HookHandle <> 0 then UnhookWindowsHookEx(HookHandle); HookHandle:=0; if MouseHandle <> 0 then UnhookWindowsHookEx(MouseHandle); MouseHandle:=0; HookHandle:=0; end;
exports SetKeyHook name 'SetKeyHook', DelKeyHook name 'DelKeyHook';
begin end. |