ClientMessageBox - Display a Message Box to the User and Wait for Response |
Scroll Prev Top Next More |
The ClientMessageBox call will display informational text to the client along with an Icon and one or more buttons for the user to click.
MacroDialogRC ClientMessageBox(string message, string title [, MacroMessageType icon] [, MacroButtons buttons] [, int timeOut]) |
message
Required. The message displayed to the user in the message box.
title
Required. The title displayed at the top of the message box.
icon
Optional. Icon to be displayed. Default value is MacroMessageType.info
buttons
Optional. Buttons to be displayed. Default value is MacroButtons.ok
timeout
Optional. Number of milliseconds to wait for client response. -1 means no timeout (indefinite wait). Default value is -1 (indefinite wait)
Your macro code will wait until the user clicks on a button unless the timeout parameter is used. You can then check on which button was clicked by setting a MacroDialogRC value as the return and using the MacroDialogRC in logic.
public override MacroRunResult run()
{
MacroDialogRC rc = this.ClientMessageBox("Would you like me to Logon?", "Sample Logon",
MacroMessageType.info, MacroButtons.yes | MacroButtons.no | MacroButtons.cancel);
if (rc == MacroDialogRC.yes)
{
this.oScreen.putCommand("simmy[enter]",2000);
this.oScreen.putCommand("2[enter]", 2000);
this.oScreen.putCommand("simmy[tab]host[enter]",2000);
this.oScreen.putCommand("[clear]", 1000);
this.oScreen.putCommand("info[enter]");
}
return MacroRunResult.ok;
}