WINDOW — Control TCC’s
display window.
Syntax:
WINDOW verb "newtitle"
| verb | an action to alter the window; you may only give one |
"newtitle" | a new title to rename the window |
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 | |
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=r,c | resize the console screen buffer | |
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 |
DETACH | detach a Take Command tab to a standalone console window | |
VDESKTOP=id | move TCC’s console window to a different virtual desktop | |
INFO | † | do not activate the window, but display a bunch of information about it |
VDESKLIST | † | list virtual desktops; does not affect TCC’s window |
TRAYLIST | † | list windows in the tray, i.e. windows managed by CDTrayMgr.exe. |
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 verb, 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.
In the SIZE verb,
r and c are the
number of rows and columns for the console screen buffer — both
unsigned integers. You cannot make the buffer smaller than the visible viewport.
r must also be between 5 and 9999 rows;
c must be between 20 and 512 columns.
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.
VDESKTOP=id
has a very limited usefulness: it can only move TCC’s own console
window. It cannot move Take Command’s window, or Windows Terminal’s
window, or Console2’s window. It cannot move another program’s
console window, e.g. when TCC is a child process of the console
window’s owner. It can only move its own window. Sorry.
Microsoft’s documented IVirtualDesktopManager
API is lame.
The desktop id can be either a number 1 to
n for the first, second, third, etc. virtual desktop; or else
a name, e.g. VDESKTOP="Desktop 2".
Virtual desktops were introduced in Windows 10; this feature will not work in earlier versions of Windows.
The VDESKLIST and TRAYLIST
verbs are mostly for my own use in debugging. I am documenting them on the
chance that they might be useful to someone else. VDESKLIST lists
Windows 10 virtual desktops; TRAYLIST lists windows currently managed
by CDTrayMgr.exe. Neither one
does anything to TCC’s window. They just dump info to standard output.
• Note: This command has been completely reimplemented to better support Windows Terminal, Console2, and ConEmu.
• Note: The POS
verb with only two arguments, and the ALIGN, INFO,
PARK, VDESKLIST, and TRAYLIST verbs, are all
incompatible with TCC’s internal WINDOW command. To be compatible,
use POS with all four arguments, using * for any value
you don’t want to change.