MQL4 - automated forex trading   /  

Documentation

MQL4 Reference  Standard constants  MessageBox

 

The MessageBox() function return codes.
If a message box has a Cancel button, the function returns the IDCANCEL value if either the ESC key is pressed or the Cancel button is selected. If the message box has no Cancel button, pressing ESC has no effect.
Note: MessageBox return codes defined in the WinUser32.mqh file

ConstantValueDescription
IDOK1OK button was selected.
IDCANCEL2Cancel button was selected.
IDABORT3Abort button was selected.
IDRETRY4Retry button was selected.
IDIGNORE5Ignore button was selected.
IDYES6Yes button was selected.
IDNO7No button was selected.
IDTRYAGAIN10Try Again button was selected.
IDCONTINUE11Continue button was selected.

The MessageBox function flags specify the contents and behavior of the dialog box. This value can be a combination of flags from the following groups of flags.

To indicate the buttons displayed in the message box, specify one of the following values.

ConstantValueDescription
MB_OK0x00000000The message box contains one push button: OK. This is the default.
MB_OKCANCEL0x00000001The message box contains two push buttons: OK and Cancel.
MB_ABORTRETRYIGNORE0x00000002The message box contains three push buttons: Abort, Retry, and Ignore.
MB_YESNOCANCEL0x00000003The message box contains three push buttons: Yes, No, and Cancel.
MB_YESNO0x00000004The message box contains two push buttons: Yes and No.
MB_RETRYCANCEL0x00000005The message box contains two push buttons: Retry and Cancel.
MB_CANCELTRYCONTINUE0x00000006Windows 2000: The message box contains three push buttons: Cancel, Try Again, Continue. Use this message box type instead of MB_ABORTRETRYIGNORE.

To display an icon in the message box, specify one of the following values.

ConstantValueDescription
MB_ICONSTOP, MB_ICONERROR, MB_ICONHAND0x00000010A stop-sign icon appears in the message box.
MB_ICONQUESTION0x00000020A question-mark icon appears in the message box.
MB_ICONEXCLAMATION, MB_ICONWARNING0x00000030An exclamation-point icon appears in the message box.
MB_ICONINFORMATION, MB_ICONASTERISK0x00000040An icon consisting of a lowercase letter i in a circle appears in the message box.

To indicate the default button, specify one of the following values.

ConstantValueDescription
MB_DEFBUTTON10x00000000The first button is the default button. MB_DEFBUTTON1 is the default unless MB_DEFBUTTON2, MB_DEFBUTTON3, or MB_DEFBUTTON4 is specified.
MB_DEFBUTTON20x00000100The second button is the default button.
MB_DEFBUTTON30x00000200The third button is the default button.
MB_DEFBUTTON40x00000300The fourth button is the default button.

MessageBox() function behavior flags are defined in the WinUser32.mqh file, this is why this heading file must be included to programs through #include <WinUser32.mqh>. Not all possible flags are listed here. For more details, please refer to Win32 API description.