#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$ParentWin = GUICreate("Parent GUI", 250, 250, -1, -1, BitOr($WS_POPUP, $WS_MAXIMIZE))
$Button = GUICtrlCreateButton("Child", 20, 50)
GUISetState()
$ChildWin = GUICreate("Child GUI", 200, 200, -1, -1, -1, -1, $ParentWin)
While 1
$aMsg = GUIGetMsg(1)
Select
Case $aMsg[0] = $GUI_EVENT_CLOSE
If $aMsg[1] = $ParentWin Then Exit
If $aMsg[1] = $ChildWin Then
GUISetState(@SW_ENABLE, $ParentWin)
GUISetState(@SW_HIDE, $ChildWin)
EndIf
Case $aMsg[0] = $Button
GUISetState(@SW_DISABLE, $ParentWin)
GUISetState(@SW_SHOW, $ChildWin)
EndSelect
WEnd