private static IntPtr SetHook(LowLevelkeyboardProc proc) { using (Process curProcess = Process.GetCurrentProcess()) using (ProcessModule curModule = curProcess.MainModule) { return(SetWindowsHookEx(WH_KEYBOARD_LL, proc, GetModuleHandle(curModule.ModuleName), 0)); } }
private static extern IntPtr SetWindowsHookEx(int idHook, LowLevelkeyboardProc lpfn, IntPtr hMod, uint dweTreadId);