Class WindowsMessageBoxManager
- Namespace
- VisioForge.Core
- Assembly
- VisioForge.Core.dll
Provides functionality to customize MessageBox button text on a per-thread basis using Windows hooks. This class allows localization or customization of standard MessageBox buttons (OK, Cancel, Yes, No, etc.).
public class WindowsMessageBoxManagerInheritance
Inherited Members
Remarks
This manager works by intercepting Windows messages using SetWindowsHookEx and modifying button text when a MessageBox dialog is initialized. Each thread that requires customization must call VisioForge.Core.WindowsMessageBoxManager.Register before showing MessageBoxes and VisioForge.Core.WindowsMessageBoxManager.Unregister when done.
Fields
Abort
Gets or sets the text for the Abort button in MessageBox dialogs. The ampersand (&) character indicates the keyboard accelerator. Default value is "&Abort".
public static string AbortField Value
Cancel
Gets or sets the text for the Cancel button in MessageBox dialogs. The ampersand (&) character indicates the keyboard accelerator. Default value is "&Cancel".
public static string CancelField Value
Ignore
Gets or sets the text for the Ignore button in MessageBox dialogs. The ampersand (&) character indicates the keyboard accelerator. Default value is "&Ignore".
public static string IgnoreField Value
No
Gets or sets the text for the No button in MessageBox dialogs. The ampersand (&) character indicates the keyboard accelerator. Default value is "&No".
public static string NoField Value
OK
Gets or sets the text for the OK button in MessageBox dialogs. The ampersand (&) character indicates the keyboard accelerator. Default value is "&OK".
public static string OKField Value
Retry
Gets or sets the text for the Retry button in MessageBox dialogs. The ampersand (&) character indicates the keyboard accelerator. Default value is "&Retry".
public static string RetryField Value
Yes
Gets or sets the text for the Yes button in MessageBox dialogs. The ampersand (&) character indicates the keyboard accelerator. Default value is "&Yes".
public static string YesField Value
Methods
Register()
Enables MessageBoxManager functionality on the current thread by installing a Windows hook.
public static void Register()Remarks
MessageBoxManager functionality is enabled on current thread only. Each thread that needs MessageBoxManager functionality has to call this method. Call VisioForge.Core.WindowsMessageBoxManager.Unregister when MessageBox customization is no longer needed.
Exceptions
- NotSupportedException
-
Thrown if a hook is already registered for the current thread.
Unregister()
Disables MessageBoxManager functionality on the current thread by removing the Windows hook.
public static void Unregister()Remarks
Disables MessageBoxManager functionality on current thread only. This method should be called when MessageBox customization is no longer needed to free system resources.