Function:
MessageBox(hWnd, lpText, lpCaption, uType)

 

Description:
Creates, displays, and operates a message box. The message box contains an application-defined message and title, plus any combination of predefined icons and push buttons.

 

Parameters:
hWnd: Identifies the owner window of the message box to be created (ie. WindowHandle).
lpText: A string containing the message to be displayed.
lpCaption: A string used for the dialog box title. If this parameter is NULL, the default title Error is used.
uType: Specifies a set of bit flags that determine the contents and behavior of the dialog box. This parameter can be a combination of flags from the following groups of flags:
Buttons:
0 - only the OK button
1 - OK and Cancel buttons
2 - Abort, Retry and Ignore buttons
3 - Yes, No, and Cancel buttons
4 - Yes and No buttons
5 - Retry and Cancel buttons
Icons:
16 - Critical message icon
32 - Warning query icon
48 - Warning message icon
64 - Information message icon
4096 - Displays a SystemModal dialog box
Default button:
0 - The 1st button is the default
256 - The 2nd button is the default
512 - The 3rd button is the default


Returns:
If the function succeeds, the return value is one of the following menu-item values returned by the dialog box:
1 - OK button
2 - Cancel button
3 - Abort button
4 - Retry button
5 - Ignore button
6 - Yes button
7 - No button

Example:
Click on the calc icon to view a sample of the MessageBox function.