public static void Show( string text, string caption, Win32MessageBoxType type, DeferredInvokeHandler callback) { IntPtr winHandle = Application.Window.Handle; new Thread(args => { int num = MessageBox(winHandle, text, caption, type); if (callback == null) { return; } Application.DeferredInvoke(callback, num); }).Start(); }
private static extern int MessageBox( IntPtr hWnd, string text, string caption, Win32MessageBoxType type);