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

Register() public static méthode

Enables MessageBoxManager functionality
MessageBoxManager functionality is enabled on current thread only. Each thread that needs MessageBoxManager functionality has to call this method.
public static Register ( ) : void
Résultat void
        public static void Register()
        {
            if (hHook != IntPtr.Zero)
                throw new NotSupportedException("One hook per thread allowed.");
            hHook = SetWindowsHookEx(WH_CALLWNDPROCRET, hookProc, IntPtr.Zero, AppDomain.GetCurrentThreadId());
        }

Usage Example

 static RtlMessageBox()
 {
     MessageBoxManager.Register();
 }