MessageBoxExA function (winuser.h)
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. The buttons are in the language of the system user interface.
Currently MessageBoxEx and MessageBox work the same way.
int MessageBoxExA( HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType, WORD wLanguageId );
A handle to the owner window of the message box to be created. If this parameter is NULL, the message box has no owner window.
The message to be displayed.
The dialog box title. If this parameter is NULL, the default title Error is used.
The contents and behavior of the dialog box. For information on the supported flags, see MessageBox.
The language for the text displayed in the message box button(s). Specifying a value of zero (0) indicates to display the button text in the default system language. If this parameter is
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), the current language associated with the calling thread is used.
To specify a language other than the current language, use the MAKELANGID macro to create this parameter. For more information, see MAKELANGID.
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 will no effect - unless an MB_OK button is present. If an MB_OK button is displayed and the user presses ESC, the return value will be IDOK.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
If the function succeeds, the return value is one of the following menu-item values.
||The Abort button was selected.|
||The Cancel button was selected.|
||The Continue button was selected.|
||The Ignore button was selected.|
||The No button was selected.|
||The OK button was selected.|
||The Retry button was selected.|
||The Try Again button was selected.|
||The Yes button was selected.|
When you use a system-modal message box to indicate that the system is low on memory, the strings pointed to by the lpText and lpCaption parameters should not be taken from a resource file because an attempt to load the resource may fail.
If you create a message box while a dialog box is present, use a handle to the dialog box as the hWnd parameter. The hWnd parameter should not identify a child window, such as a control in a dialog box.
The winuser.h header defines MessageBoxEx as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
|Minimum supported client||Windows 2000 Professional [desktop apps only]|
|Minimum supported server||Windows 2000 Server [desktop apps only]|
|Header||winuser.h (include Windows.h)|