WINDOW — Control TCC’s display window.

Syntax:
WINDOW verb "newtitle"

verban action to alter the window; you may only give one
"newtitle"a new title to rename the window
MINminimize the window (use RESTORE bring it back)
MAXmaximize the window (use RESTORE to return it to its previous size)
HIDEhide the window (use RESTORE to make it visible again)
RESTORErestore the window to its normal size and make it visible
TOPMOSTdisplay the window above all non-topmost windows (use NOTOPMOST to fix it)
NOTOPMOSTmake a TOPMOST window display normally again
TOPmove the window to the front
BOTTOMmove the window behind all other windows
POS=x,y,w,hmove and resize the window
POS=x,ymove the window to the specified coordinates
SIZE=r,cresize the console screen buffer
ICON=fileattempt to extract an icon from file and apply it to the window
TRANS=nset the window transparency; n is 0 (invisible) to 255 (opaque)
FLASH=type,countflash the window; args as per FLASHWINFO
TRAYhide the window, and show its icon in the system tray (use RESTORE to undo)
CENTERcenter the window in its current monitor
ALIGN=n,Malign the window relative to a monitor’s edges
PARK=vhw,Mmove and resize the window to a monitor’s corner or edge
DETACHdetach a Take Command tab to a standalone console window
VDESKTOP=idmove TCC’s console window to a different virtual desktop
INFOdo not activate the window, but display a bunch of information about it
VDESKLISTlist virtual desktops; does not affect TCC’s window
TRAYLISTlist 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 left8: top center 9: top right
4: left center5: center6: right center
1: bottom left2: bottom center3: 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:

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.