CWnd::MessageBox

int MessageBox( LPCTSTR lpszText, LPCTSTR lpszCaption = NULL, UINT nType = MB_OK );

Return Value

Specifies the outcome of the function. It is 0 if there is not enough memory to create the message box.

Parameters

lpszText

Points to a CString object or null-terminated string containing the message to be displayed.

lpszCaption

Points to a CString object or null-terminated string to be used for the message-box caption. If lpszCaption is NULL, the default caption “Error” is used.

nType

Specifies the contents and behavior of the message box.

Remarks

Creates and displays a window that contains an application-supplied message and caption, plus a combination of the predefined icons and pushbuttons described in the Message-Box Styles list. Use the global function AfxMessageBox instead of this member function to implement a message box in your application.

The following shows the various system icons that can be used in a message box:

MB_ICONHAND, MB_ICONSTOP, and MB_ICONERROR
MB_ICONQUESTION
MB_ICONEXCLAMATION and MB_ICONWARNING
MB_ICONASTERISK and MB_ICONINFORMATION

CWnd OverviewClass MembersHierarchy Chart

See Also   ::MessageBox, AfxMessageBox