Win Functions

Functions to retrieve information about one or more windows, or make a variety of changes to a window. Click on a function name for details.

Function Description
WinActivate Activates the specified window.
WinActivateBottom Same as WinActivate except that it activates the bottommost matching window rather than the topmost.
WinActive Checks if the specified window exists and is currently active (foremost).
WinClose Closes the specified window.
WinExist Checks if the specified window exists.
WinGetClass Retrieves the specified window's class name.
WinGetClientPos Retrieves the position and size of the specified window's client area.
WinGetControls Returns the control names for all controls in the specified window.
WinGetControlsHwnd Returns the unique ID numbers for all controls in the specified window.
WinGetCount Returns the number of existing windows that match the specified criteria.
WinGetID Returns the unique ID number of the specified window.
WinGetIDLast Returns the unique ID number of the last/bottommost window if there is more than one match.
WinGetList Returns the unique ID numbers of all existing windows that match the specified criteria.
WinGetMinMax Returns the state whether the specified window is maximized or minimized.
WinGetPID Returns the Process ID number of the specified window.
WinGetPos Retrieves the position and size of the specified window.
WinGetProcessName Returns the name of the process that owns the specified window.
WinGetProcessPath Returns the full path and name of the process that owns the specified window.
WinGetStyle
WinGetExStyle
Returns the style or extended style (respectively) of the specified window.
WinGetText Retrieves the text from the specified window.
WinGetTitle Retrieves the title of the specified window.
WinGetTransColor Returns the color that is marked transparent in the specified window.
WinGetTransparent Returns the degree of transparency of the specified window.
WinHide Hides the specified window.
WinKill Forces the specified window to close.
WinMaximize Enlarges the specified window to its maximum size.
WinMinimize Collapses the specified window into a button on the task bar.
WinMinimizeAll
WinMinimizeAllUndo
Minimizes or unminimizes all windows.
WinMove Changes the position and/or size of the specified window.
WinMoveBottom Sends the specified window to the bottom of stack; that is, beneath all other windows.
WinMoveTop Brings the specified window to the top of the stack without explicitly activating it.
WinRedraw Redraws the specified window.
WinRestore Unminimizes or unmaximizes the specified window if it is minimized or maximized.
WinSetAlwaysOnTop Makes the specified window stay on top of all other windows (except other always-on-top windows).
WinSetEnabled Enables or disables the specified window.
WinSetRegion Changes the shape of the specified window to be the specified rectangle, ellipse, or polygon.
WinSetStyle
WinSetExStyle
Changes the style or extended style of the specified window, respectively.
WinSetTitle Changes the title of the specified window.
WinSetTransColor Makes all pixels of the chosen color invisible inside the specified window.
WinSetTransparent Makes the specified window semi-transparent.
WinShow Unhides the specified window.
WinWait Waits until the specified window exists.
WinWaitActive
WinWaitNotActive
Waits until the specified window is active or not active.
WinWaitClose Waits until no matching windows can be found.

Remarks

To discover the unique ID number of the window that the mouse is currently hovering over, use MouseGetPos.

Window titles and text are case sensitive. Hidden windows are not detected unless DetectHiddenWindows has been turned on.

Related

SetWinDelay, Control functions, Gui object (for windows created by the script)