ACTIVATE — Activate a window, and optionally make changes to it.

Syntax:
ACTIVATE /P /R "title" verb "newtitle"

/Pmatch the "title" against program names
/Rreturn focus to the original foreground window when done
"title"the window to activate; required
verban 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:

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
CLOSEclose the window
DISABLEdisable mouse and keyboard input to the window (use ENABLE to fix it)
ENABLEre-enable mouse and keyboard input to a window crippled by DISABLE
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=w,hresize the window without moving it
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
INFOdo 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 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.


• 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.