#include <GUIConstantsEx.au3>
Opt('MustDeclareVars', 1)
Example()
Func Example()
Local $msg
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
EndFunc ;==>Example