[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
MessageBox( hWnd, cnText, cTitle, nStyle )-> <nRetValue>
------------------------------------------------------------------------------
PARAMETER:
<hWnd> Is the handle that identifies the container window of the
messagebox dialog to be created. If it is zero, it will not
have a container window.
<cnText> Is the message to be displayed. This can be a string or
a numeric value.
<cTitle> Is the title of the dialog box to be displayed. The
default title is "Error"
<nStyle> Specifies the contents and behavior of the DialogBox. This
parameter can be a combination of the following values:
MB_ABORTRETRYIGNORE The message box contains three push
[2] buttons: Abort, Retry, and Ignore.
MB_APPLMODAL [0] The user must respond to the message
box before continuing work in the
window identified by <hwnd>.
However, the user can move to the
windows of other applications and work
in those windows. MB_APPLMODAL is the
default if neither MB_SYSTEMMODAL nor
nor MB_TASKMODAL is specified.
MB_DEFBUTTON1 [0] The first button is the default. Note
that the first button is always the
default unless MB_DEFBUTTON2 or
MB_DEFBUTTON3 is specified
MB_DEFBUTTON2 [256] The second button is the default
MB_DEFBUTTON3 [512] The third button is the default
MB_ICONASTERISK [54] Same as MB_ICONINFORMATION
MB_ICONEXCLAMATION An exclamation-point icon appears in
[48] the message box.
MB_ICONHAND [16] Same as MB_ICONSTOP
MB_ICONINFORMATION An icon consisting of a lowercase
[54] letter "I" in a circle appears in the
message box.
MB_ICONQUESTION [32] A question-mark icon appears in the box
MB_ICONSTOP [16] A stop-sign icon appears in the box
MB_OK [0] The message box contains one OK button
MB_OKCANCEL [1] The message box contains two push
buttons OK and Cancel.
MB_RETRYCANCEL [5] The message box contains two push
buttons Retry and Cancel
MB_SYSTEMMODAL[4096] All applications are suspended until
the user responds to the message box.
Unless the application specifies
MB_ICONHAND, the message box does not
become modal until after it is created;
consequently, the parent window and
other windows continue to receive
messages resulting from its activation.
System-modal message boxes are used to
notify the user of serious, potentially
damaging errors that require immediate
attention (for example, running out of
memory).
MB_TASKMODAL [8192] Same as MB_APPLMODAL except that all
top-level windows belonging to the
current task are disabled if <hWnd> is
Zero. This flag should be used when the
calling application or library does not
have a window handle available but
still needs to prevent input to other
windows in the current application
without suspending other applications.
MB_YESNO [4] The message box contains two push
buttons Yes and No.
MB_YESNOCANCEL [3] The message box contains three push
buttons Yes, No, and Cancel.
RETURNS:
The return value is 0 if there is no enough memory to create the message
box. Otherwise, it is one of the following menu-item values returned by
the dialogbox :
IDOK [1] OK button was selected.
IDCANCEL [2] Cancel button was selected.
IDABORT [3] Abort button was selected.
IDRETRY [4] Retry button was selected.
IDIGNORE [5] Ignore button was selected.
IDYES [6] Yes button was selected.
IDNO [7] No button was selected.
If a message box has a Cancel button, the IDCANCEL value will be returned
if either the ESC key is pressed or the Cancel button is selected. If the
message box has no Cancel button, pressing ESC has no effect.
DESCRIPTION:
The MessageBox function creates, displays, and operates a message-box
window. The message box contains an application-defined message and title,
plus any combination of the predefined icons and push buttons described in
the <nStyle> parameter.
FiveWin supplies as built-in function the most common used messagebox
styles, see the Msg...() functions and SAMPLES\TestMsg.prg
EXAMPLE:
+--------------------------------------------------------------+
| /* Create a YesNo Messagebox */ |
| |
| IF MessageBox( 0, "Delete the File ?",; |
| "Files", MB_YESNOCANCEL) == IDOK |
| [ do whatever you have to do ] |
| ENDIF |
| |
+--------------------------------------------------------------+
SOURCE:
SOURCE\WINAPI\MSGBOX.C
See Also:
MsgInfo
MsgAlert
MsgYesNo
MsgStop
MsgAbout
MsgBeep
MsgMeter
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson