public void UnHook() { WindowsAPI.UnhookWindowsHookEx(hHook); }
public void SetHook() { KeyboardHookFunction = new WindowsAPI.HookProc(KeyboardHookProcess); hHook = WindowsAPI.SetWindowsHookEx(WindowsAPI.WH_KEYBOARD_LL, KeyboardHookFunction, WindowsAPI.GetModuleHandle(Process.GetCurrentProcess().MainModule.ModuleName), 0); }