实例:#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("主窗口", 390, 229)
$Button1 = GUICtrlCreateButton("弹出窗口1", 128, 96, 129, 33, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
_Test()
EndSwitch
WEnd
Func _Test()
$Form2 = GUICreate("窗口1", 300, 200)
$Button2 = GUICtrlCreateButton("关闭窗口1", 100, 96, 129, 33, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
GUIDelete("窗口1")
WinActivate("主窗口")
GUISetState(@SW_ENABLE, $Form1)
ExitLoop
Case $Button2
GUIDelete("窗口1")
WinActivate("主窗口")
GUISetState(@SW_ENABLE, $Form1)
ExitLoop
EndSwitch
WEnd
EndFunc
|