# Function Reference

GUISetState

Changes the state of a GUI window.

GUISetState ( [flag [, winhandle]] )

Parameters

flag | [optional] @SW_SHOW = Shows a previously hidden window (default) @SW_HIDE = Hide window @SW_MINIMIZE = Minimize window @SW_MAXIMIZE = Maximize window @SW_RESTORE = Undoes a window minimization @SW_DISABLE = Disables the window @SW_ENABLE = Enables the window @SW_LOCK = Lock the window to avoid repainting. @SW_UNLOCK = Unlock windows to allow painting.
winhandle | [optional] Windows handle as returned by GUICreate (default is the previously used window).

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

When windows are created they are initially hidden so you must use this function to display them (@SW_SHOW).
Only one window can be locked with @SW_LOCK and it is always the last one referenced.

Related

GUICreate

Example

#include <GUIConstants.au3>
GUICreate ("My GUI") ; start the definition
GUISetState () ; will display an empty dialog box
; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend