private IntPtr HookFunc(int nCode, IntPtr wParam, IntPtr lParam) { if (nCode >= 0) { int num = wParam.ToInt32(); if ((num == 256 || num == 260) && this.KeyDown != null) { this.KeyDown((KeyboardHook.VKeys)Marshal.ReadInt32(lParam)); } if ((num == 257 || num == 261) && this.KeyUp != null) { this.KeyUp((KeyboardHook.VKeys)Marshal.ReadInt32(lParam)); } } return(KeyboardHook.CallNextHookEx(this.hookID, nCode, wParam, lParam)); }
public void Uninstall() { KeyboardHook.UnhookWindowsHookEx(this.hookID); }