#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", 142, 45, 192, 124)
$Button1 = GUICtrlCreateButton("Button1", 8, 8, 123, 25)
GUISetState(@SW_SHOW,$Form1)
Do
Until GUIGetMsg() = -3
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$Form2 = GUICreate("Form2", 142, 45, 192, 124)
GUISetState(@SW_SHOW,$Form2)
Do
Until GUIGetMsg() = -3
EndSwitch
WEnd