public KeyHook() { hookProc = HookProc; using (Process curProcess = Process.GetCurrentProcess()) { using (ProcessModule curModule = curProcess.MainModule) { hookId = SetWindowsHookEx(13, hookProc, GetModuleHandle(curModule.ModuleName), 0); } } }
private static extern IntPtr SetWindowsHookEx(int idHook, LowLevelKeyProc callback, IntPtr hInstance, uint threadId);
public KeyHook() { this.keyboardProc = KeyboardHookProc; }
private static extern IntPtr SetWindowsHookEx(int idHook, LowLevelKeyProc lpfn, IntPtr hMod, int dwThreadId);