ACTIVATE — Activate a window,
and optionally make changes to it.
Syntax:
ACTIVATE /P /R "title" verb "newtitle"
/P | match the "title" against program names |
/R | return focus to the original foreground window when done |
"title" | the window to activate; required |
| verb | an action to alter the selected window; you may only give one |
"newtitle" | a new title to rename the window |
You must specify a title. You can use wildcards;
the first window found with a matching name will be activated. Alternatively,
you may use =pid to search for a
window belonging to the specified program id. The pid
may be in decimal, or hexadecimal with a leading 0x.
If you know the window’s handle, you can also specify that with the
syntax HWND==hwnd. Note that there
are two equals signs after the HWND. The
hwnd may be in decimal, or hexadecimal with a
leading 0x. This syntax is not supported by TCC’s
ACTIVATE.
The following verbs are supported; you may only use one at a time:
MIN | minimize the window (use RESTORE bring it back) | |
MAX | maximize the window (use RESTORE to return it to its previous size) | |
HIDE | hide the window (use RESTORE to make it visible again) | |
RESTORE | restore the window to its normal size and make it visible | |
CLOSE | close the window | |
DISABLE | disable mouse and keyboard input to the window (use ENABLE to fix it) | |
ENABLE | re-enable mouse and keyboard input to a window crippled by DISABLE | |
TOPMOST | display the window above all non-topmost windows (use NOTOPMOST to fix it) | |
NOTOPMOST | make a TOPMOST window display normally again | |
TOP | move the window to the front | |
BOTTOM | move the window behind all other windows | |
POS=x,y,w,h | move and resize the window | |
POS=x,y | † | move the window to the specified coordinates |
SIZE=w,h | † | resize the window without moving it |
ICON=file | attempt to extract an icon from file and apply it to the window | |
TRANS=n | set the window transparency; n is 0 (invisible) to 255 (opaque) | |
FLASH=type,count | flash the window; args as per FLASHWINFO | |
TRAY | hide the window, and show its icon in the system tray (use RESTORE to undo) | |
CENTER | center the window in its current monitor | |
ALIGN=n,M | † | align the window relative to a monitor’s edges |
PARK=vhw,M | † | move and resize the window to a monitor’s corner or edge |
INFO | † | do not activate the window, but display a bunch of information about it |
You can use "newtitle"
to rename the window. The new title must be quoted; otherwise it will
be interpreted as a verb.
In the POS and SIZE verbs, the
x and y arguments are signed integers;
w and h are unsigned. Any of these may
be replaced with an asterisk to keep the current value. For example, POS=*,*,400,150
will resize the window to 400×150 pixels without changing its position.
TRAY mode will only work if
(a) TCC is running elevated, and (b) CDTrayMgr.exe
is available. You can put CDTrayMgr.exe in
the plugin’s directory, in Take Command’s install directory, or
in any directory in the search path.
ALIGN=n,M
moves the window relative to a monitor. n is required;
possible values are:
| 7: top left | 8: top center | 9: top right |
| 4: left center | 5: center | 6: right center |
| 1: bottom left | 2: bottom center | 3: bottom right |
The monitor number M is optional. If is zero or greater than the number of monitors, it defaults to the primary monitor. If you do not specify a monitor number, the window will be aligned on whichever monitor it currently occupies.
PARK=vhw,M
moves and resizes the window to a corner or edge of a monitor. The
vhw argument has three parts to specify the
vertical and horizontal position, and the window’s new width:
T for the top half of the monitor,
B for the bottom half, or nothing to fill the full height of the monitor. L for the left side, R
for the right side, or M for the middle. This part is required. 1/2 or just /2 for half the width
of the monitor; 1/3 or just /3 for one-third; 2/3 for two-thirds;
or 1/4 or just /4 for one-fourth of the monitor’s width. If you do not
give a width, the default is one-half the monitor’s width. The monitor number M is optional. If is zero or greater than the number of monitors, it defaults to the primary monitor. If you do not specify a monitor number, the window will be parked on whichever monitor it currently occupies.
• Note: This command has been completely reimplemented to better support Windows Terminal, Console2, and ConEmu.
• Note: The SIZE
verb, the POS verb with only two arguments, and the ALIGN,
PARK, and INFO verbs, are all incompatible with TCC’s
internal ACTIVATE command. To be compatible, use POS with
all four arguments, using * for any values you don’t
want to change.
The HWND==hwnd syntax is also new,
and is not compatible with TCC.
The /P option also is not supported by TCC.