MessageBox
The MessageBox function 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.
int MessageBox(
HWND hWnd, // handle of owner window
LPCTSTR lpText, // address of text in message box
LPCTSTR lpCaption, // address of title of message box
UINT uType // style of message box
);
Parameters
hWnd
Identifies the owner window of the message box to be created. If this parameter is NULL, the
message box has no owner window.
lpText
Points to a null-terminated string containing the message to be displayed.
lpCaption
Points to a null-terminated string used for the dialog box title. If this parameter is NULL, the
default title Error is used.
uType
Specifies the contents and behavior of the dialog box. This parameter can be a combination of the
following values:
Value Meaning
MB_ABORTRETRYIGNORE The message box contains three push buttons: Abort, Retry,
and Ignore.
MB_APPLMODAL The user must respond to the message box before continuing work in the
window identified by the hWnd parameter. However, the user can move to the windows of other
applications and work in those windows. Depending on the hierarchy of windows in the
application, the user may be able to move to other windows within the application. All child
windows of the parent of the message box are automatically disabled, but popup windows are not.
评论0