private static IntPtr SetHook(User32.LowLevelMouseProc proc) { using (Process curProcess = Process.GetCurrentProcess()) using (ProcessModule curModule = curProcess.MainModule) { return(User32.SetWindowsHookEx(WH_MOUSE_LL, proc, User32.GetModuleHandle(curModule.ModuleName), 0)); } }
static IntPtr SetHook(User32.LowLevelMouseProc proc) { var moduleHandle = User32.GetModuleHandle(null); var setHookResult = User32.SetWindowsHookEx(WH_MOUSE_LL, proc, moduleHandle, 0); if (setHookResult == IntPtr.Zero) { throw new Win32Exception(); } return(setHookResult); }
// Token: 0x06000116 RID: 278 RVA: 0x00008F60 File Offset: 0x00007160 private static IntPtr SetHook(User32.LowLevelMouseProc proc) { IntPtr result; using (Process currentProcess = Process.GetCurrentProcess()) { using (ProcessModule mainModule = currentProcess.MainModule) { result = User32.SetWindowsHookEx(14, proc, User32.GetModuleHandle(mainModule.ModuleName), 0U); } } return(result); }
public static extern IntPtr SetWindowsHookEx(int idHook, User32.LowLevelMouseProc lpfn, IntPtr hMod, uint dwThreadId);