====== MessageBox ======
===== Description =====
Display a modal pop-up message box.
===== Function prototype =====
uint MessageBox
===== Arguments =====
^ Name ^ Type ^ Comment ^
| //Message// | string | The text to be displayed in the message box. |
| //Style// | uint | A conbination of bit flags that specify the buttons, icons and behaviour of the message box (see codes below). |
The supported values of //Style// are identical to those of the Microsoft Foundation Classes [[http://msdn.microsoft.com/en-us/library/w0kywcw3%28VS.80%29.aspx|Message box styles]], which are:
* Message box types
* 0x00000000 (MB_OK) - The message box contains one pushbutton: OK.
* 0x00000001 (MB_OKCANCEL) - The message box contains two pushbuttons: OK and Cancel.
* 0x00000002 (MB_ABORTRETRYIGNORE) - The message box contains three pushbuttons: Abort, Retry, and Ignore.
* 0x00000003 (MB_YESNOCANCEL) The message box contains three pushbuttons: Yes, No, and Cancel.
* 0x00000004 (MB_YESNO) - The message box contains two pushbuttons: Yes and No.
* 0x00000005 (MB_RETRYCANCEL) - The message box contains two pushbuttons: Retry and Cancel.
* Message-Box Icons
* 0x00000010 (MB_ICONSTOP) A stop-sign icon appears in the message box.
* 0x00000020 (MB_ICONQUESTION) - A question-mark icon appears in the message box.
* 0x00000030 (MB_ICONEXCLAMATION) - An exclamation-point icon appears in the message box.
* 0x00000040 (MB_ICONINFORMATION) - An icon consisting of an "I" in a circle appears in the message box.
* Message-Box Default Buttons
* 0x00000000 (MB_DEFBUTTON1) - The first button is the default. Note that the first button is always the default unless MB_DEFBUTTON2 or MB_DEFBUTTON3 is specified.
* 0x00000100 (MB_DEFBUTTON2) - The second button is the default.
* 0x00000200 (MB_DEFBUTTON3) - The third button is the default.
===== Return value =====
The return value is identical to those of the Microsoft Foundation Classes [[http://msdn.microsoft.com/en-us/library/as6se7cb%28VS.80%29.aspx|AfxMessageBox]] function, which are:
* 0 - An error occurred:
* 1 (IDOK) - The OK button was selected.
* 2 (IDCANCEL) The Cancel button was selected.
* 3 (IDABORT) - the Abort button was selected.
* 4 (IDRETRY) - The Retry button was selected.
* 5 (IDIGNORE) - The Ignore button was selected.
* 6 (IDYES) - The Yes button was selected.
* 7 (IDNO) - The No button was selected.
===== Example =====
// style is question icon and yes/no buttons, testing for IDYES
if >
application.Restart
endif
... the output of which looks like:
{{:plugins:general:zeoscript:reference:functions:messagebox.png|An example message box}}
===== Comments =====
None.