System.Windows.Forms.MessageBoxManager.SetWindowsHookEx C# (CSharp) Méthode

SetWindowsHookEx() private méthode

private SetWindowsHookEx ( int idHook, HookProc lpfn, IntPtr hInstance, int threadId ) : IntPtr
idHook int
lpfn HookProc
hInstance IntPtr
threadId int
Résultat IntPtr
        private static extern IntPtr SetWindowsHookEx(int idHook, HookProc lpfn, IntPtr hInstance, int threadId);

Usage Example

Exemple #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());
 }