%SYNMSW_MSGBOX
Pop up a Windows-style message box
WSupported on Windows
|
|
|
NSupported in Synergy .NET
|
button = %SYNMSW_MSGBOX(message, [styles], [title])
or
xcall SYNMSW_MSGBOX(button, message, [styles], [title]) (Traditional Synergy only)
button
%SYNMSW_MSGBOX returns false if the user doesn’t select a message box button, but instead tries to select a menu entry. If one of the message box buttons is selected, it returns with the corresponding option below: (^VAL)
OK button selected.
Cancel button selected.
Abort button selected.
Retry button selected.
Ignore button selected.
Yes button selected.
No button selected.
Arguments
message
The message text or string. (a)
styles
(optional) One or more of the following options, which can be combined using .BOR. or the vertical bar (|) operator. If styles is not passed, %SYNMSW_MSGBOX will default to the documented default values. All options are defined in tools.def. (n)
Dialog options:
Center dialog box over application window. (Traditional Synergy only.)
Button options:
OK button only. (default)
OK and Cancel buttons.
Abort, Retry, Ignore buttons.
Yes, No, Cancel buttons.
Yes and No buttons.
Retry and Cancel buttons.
Icon style options: (No icon is the default)
Stop sign.
Question mark (?).
Exclamation point (!).
Information (i).
Default button options:
Sets default to first button. (default)
Sets default to second button.
Sets default to third button.
Modality options:
Application modal. (default)
System modal.
title
(optional) The title of the message box. (a)
Discussion
The %SYNMSW_MSGBOX function pops up a Windows-style message box and one to three buttons, depending on the arguments passed. The icon can be a stop sign, exclamation point, question mark, or information icon. Button choices are Yes, No, OK, Cancel, Abort, Retry, and Ignore. Since this function invokes the standard Windows MessageBox function, which is application-modal, no menu or other processing is available while a message box is displayed.
Message is wrapped according to the same rules as apply to the U_MESSAGE subroutine.
Styles enables you to set optional values for the dialog box, buttons and the icon on the dialog box, and modality. The options available to styles are defined in tools.def. Note the following:
- Default positioning is determined by Windows Common Dialogs and is generally centered in the screen. Specifying D_MCENTER centers the dialog box over the application window.
- The close button for the message box is disabled if you pass D_MABTRETIGN or D_MYESNO. If you pass a styles option that includes the Cancel button, the close button causes %SYNMSW_MSGBOX to return D_MIDCANCEL. If you pass D_MOK, the close button causes %SYNMSW_MSGBOX to return D_MIDOK.
If you omit title with traditional Synergy, the message box inherits the application’s window title. With Synergy .NET, the default title is the Windows default, “Error”.
In traditional Synergy, W_INIT must be called before %SYNMSW_MSGBOX, or a “Windows system not initialized” error will occur. Calling W_INIT is not required in Synergy .NET.
Additionally, note that %SYNMSW_MSGBOX cannot time out.