public static bool UnhookKeyboard() { bool result = true; if (_hHook != IntPtr.Zero) { result = USER32.UnhookWindowsHookEx(_hHook); _hHook = IntPtr.Zero; } return(result); }
/// <summary> /// Disables the hook /// </summary> /// <returns>True if hook is disabled</returns> public bool DisableHook() { if (this.mseHook == IntPtr.Zero) { return(true); } if (USER32.UnhookWindowsHookEx(this.mseHook)) { this.mseHook = IntPtr.Zero; return(true); } return(false); }