WireLess Studio Widgets Developer's Guide
WSWDG ContentsWStForm class reference

ShowMessageBox

Displays a message box.

Ole declaration

SHORT ShowMessageBox(LPCTSTR sText, LPCTSTR sCaption, LONG lOptions, LONG lDefaultButton, LONG lIcon);

Parameters
sText
The message to be displayed.
sCaption
The title of the message box.
lOptions
Specifies which option will be available for the user. If this parameter is zero, WS_MSG_BOX_OP_OK is used.
lDefaultButton
Indicates which button will receive the keyboard focus when the message box is displayed. If this parameter is zero, WS_MSG_BOX_DEFBUTTON1 is used.
lIcon
The icon to be displayed on the message box. If this parameter is zero no icon is displayed.
Return Value

On success, ShowMessageBox returns the selected option that can be one following:

On error ShowMessageBox returns WS_MSG_BOX_RET_VAL_FAILED. To get extended information, call WStError::GetLastErrorCode.

Remarks

The available options are:

To indicate which button should be default one, the following constants can be used:

The available icons are:

Example
C#
using WirelessStudioOleWidgets;
WStForm oForm = new WStForm ();
oForm.ShowMessageBox("This is a test", "WStudio", (int)WSMsgBoxConstants.WS_MSG_BOX_OP_OKCANCEL, (int)WSMsgBoxConstants.WS_MSG_BOX_DEFBUTTON2,
	(int)WSMsgBoxConstants.WS_MSG_BOX_ICON_EXCLAMATION);
Visual Basic 6 (Full Example: FieldDemoModule.bas.txt)
Public wsForm As New WStForm
...
If sObjectName = "showMessageBoxBtn" Then
	sMsgBoxTest = wsWidget.GetTextByName("msgBoxText")
	sMsgBoxCaption = wsWidget.GetTextByName("msgBoxCaption")
	iMsgBoxResult = wsForm.ShowMessageBox(sMsgBoxTest, sMsgBoxCaption, iOptions, iDefaultAs, iIcon)                
	wsWidget.SetTextByName "msgBoxResultLabel", "Result: " + MapResultValueToString(iMsgBoxResult)
End If
...	
See also

ShowPopupMessage

WStWiget class reference | WStForm class reference | WStFactory class reference | WStError class reference