# Function Reference

WinSetState

Shows, hides, minimizes, maximizes, or restores a window.

WinSetState ( "title", "text", flag )

Parameters

title | The title of the window to show. See Title special definition.
text | The text of the window to show.
flag | The "show" flag of the executed program: @SW_HIDE = Hide window @SW_SHOW = Shows a previously hidden window @SW_MINIMIZE = Minimize window @SW_MAXIMIZE = Maximize window @SW_RESTORE = Undoes a window minimization or maximization @SW_DISABLE = Disables the window @SW_ENABLE = Enables the window

Return Value

Success: | Returns 1.
Failure: | Returns 0 if window is not found.

Remarks

WinSetState is a replacement for the badly named WinShow function. WinShow is accepted as an alias but this may be withdrawn in the future.
If multiple windows match the criteria, the most recently active window is used.
@SW_MINIMIZE and @SW_MAXIMIZE even work on modal dialog windows.

Related

WinActivate, WinClose

Example

WinSetState("Untitled -", "", @SW_HIDE)
Sleep(3000)
WinSetState("Untitled -", "", @SW_SHOW)