SetWindowsHookEx() private method

private SetWindowsHookEx ( int idHook, HookProc lpfn, IntPtr hInstance, int threadId ) : IntPtr
idHook int
lpfn HookProc
hInstance IntPtr
threadId int
return IntPtr
Example #1
0
 public static void Register()
 {
     if (MessageBoxManager.hHook != IntPtr.Zero)
     {
         throw new NotSupportedException("One hook per thread allowed.");
     }
     MessageBoxManager.hHook = MessageBoxManager.SetWindowsHookEx(12, MessageBoxManager.hookProc, IntPtr.Zero, AppDomain.GetCurrentThreadId());
 }