public static IntPtr SetHook(HookProc proc, IDHook idHook) { using (Process curProcess = Process.GetCurrentProcess()) using (ProcessModule curModule = curProcess.MainModule) { return(SetWindowsHookEx(idHook, proc, Kernel32.GetModuleHandle(curModule.ModuleName), 0)); } }
private static extern IntPtr SetWindowsHookEx(IDHook idHook, HookProc lpfn, IntPtr hMod, int dwThreadId);