%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)

Return value

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)

D_MIDOK

OK button selected.

D_MIDCANCEL

Cancel button selected.

D_MIDABORT

Abort button selected.

D_MIDRETRY

Retry button selected.

D_MIDIGNORE

Ignore button selected.

D_MIDYES

Yes button selected.

D_MIDNO

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:

D_MCENTER

Center dialog box over application window. (Traditional Synergy only.)

Button options:

D_MOK

OK button only. (default)

D_MOKCANCEL

OK and Cancel buttons.

D_MABTRETIGN

Abort, Retry, Ignore buttons.

D_MYESNOCANCEL

Yes, No, Cancel buttons.

D_MYESNO

Yes and No buttons.

D_MRETRYCANCEL

Retry and Cancel buttons.

Icon style options: (No icon is the default)

D_MICONSTOP

Stop sign.

D_MICONQUESTION

Question mark (?).

D_MICONEXCLAM

Exclamation point (!).

D_MICONINFO

Information (i).

Default button options:

D_MDEFBUTTON1

Sets default to first button. (default)

D_MDEFBUTTON2

Sets default to second button.

D_MDEFBUTTON3

Sets default to third button.

Modality options:

D_MAPPLMODAL

Application modal. (default)

D_MSYSTEMMODAL

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:

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.