TASKDIALOG |
Purpose: | Display a Windows Task Dialog |
Format: | TASKDIALOG [/A[F][X]"Details" /AC"text" /AE"text" /B"text" /C /DB:n /DR:n /E /F[EISW]"text" /H /I /L /N /P=x,y /R"text" /S /T:n /V"text" /W /X] buttontype "title" "instruction" [text] |
buttontype | One or more of OK, YES, NO, RETRY, CANCEL, and/or CLOSE |
title | Text for the task dialog title |
instruction | Text for the main instruction |
text | Optional additional text that appears below the main instruction, in a smaller font |
See also: INKEY, INPUT, MSGBOX and QUERYBOX.
Usage:
The button the user chooses is indicated using the internal variable %_?. Be sure to save the return value in another variable or test it immediately; because the value of %_? changes with every internal command. The following list shows the value returned for each button:
response |
|
Yes or OK |
10 |
No |
11 |
Cancel or Close |
12 |
Retry |
13 |
If there is an error in the TASKDIALOG command itself, %_? will be set to 2.
Since TASKDIALOG doesn't write to standard output, it disables redirection allow you to enter the redirection characters (< and >) in your prompt text. If you want to use pipe characters or command separators, you will need to escape or quote them.
TASKDIALOG creates a popup dialog box. If you prefer to retrieve input from the command line, see the INKEY and INPUT commands.
You can copy the text in a TASKDIALOG window to the clipboard by entering Ctrl-C when the TASKDIALOG window has the keyboard focus.
TASKDIALOG can set three internal variables:
_taskdialog_button - the button pressed to exit TASKDIALOG
_taskdialog_radio - the selected radio button (if any) in TASKDIALOG
_taskdialog_verify - returns 1 if the verify button was checked
Example:
Display a Yes / No message box and take action depending on the result:
taskdialog yes no "Copy" "Copy all files to A:?"
if %_? == 10 copy * a:
Options:
/A"details" | TASKDIALOG will show a button that you can click to expand the dialog and view the text specified in "Details". |
/AF"details" | Like /A, but TASKDIALOG will show the details at the bottom of the dialog's footer area instead of immediately after the contents. |
/DB:xx | Default button. This can either be a number (1000-n for custom buttons, or a defined button type: |
OK
Yes
No
Cancel
Retry
Close
E | security shield |
I | information |
S | error |
W | warning |
/H | Enable hyperlinks embedded in the additional info (/A) text, the footer (/F) text, and the main instruction text. Hyperlinks are created with an <a> HTML tab. For example: |
/A"This is a hyperlink: <a href=^"https://jpsoft.com/^">Full details about Take Command 28</a>"
/N | Custom buttons (see /B and /R) are to be displayed as command links instead of push or radio buttons. |
/P | Display the task dialog at the specified screen coordinates. If /P is not specified, TCC will center the dialog. |
/T:n | Timeout after n seconds. If TASKDIALOG times out, it will return the Cancel / Close button value (12). |
/V"text" | Display a verification checkbox. If the box is checked, the command variable %_taskdialog_verify will be set when TASKDIALOG exits. |