function KBHooKProc(code: Integer; wParam: WPARAM;lParam: LPARAM):LRESULT;stdcall; export; Begin If code < 0 Then Result := CallNextHookEx( oldHook, code, wparam, lparam ) Else Result := 1; end;
function DisableKeyboard: Boolean; export; Begin oldHook := SetWindowsHookEx(WH_KEYBOARD,KBHooKProc,HInstance, 0 ); DisableKeyboard := oldHook <> 0; End;
procedure EnableKeyboard; export; Begin If oldHook <> 0 Then Begin UnhookWindowshookEx( oldHook ); oldHook := 0; End; End;