/// <summary> /// Uninstalls the global hook /// </summary> public void Unhook() { PInvoke.UnhookWindowsHookEx(hhook); }
/// <summary> /// Installs the global hook /// </summary> public void Hook() { IntPtr hInstance = PInvoke.LoadLibrary("User32"); hhook = PInvoke.SetWindowsHookEx(WH_KEYBOARD_LL, HookProc, hInstance, 0); }