本帖最后由 xiehuahere 于 2011-9-25 23:22 编辑
已经有人问过了:
http://www.autoitx.com/forum.php ... =%B8%B8%B4%B0%BF%DA
你也可以试试这个:#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 623, 442, 192, 124)
$Button1 = GUICtrlCreateButton("Launch Form2", 224, 168, 169, 65)
GUISetState()
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
GUISetState(@SW_DISABLE, $Form1)
LaunchForm2()
GUISetState(@SW_ENABLE, $Form1)
GUISetState(@SW_RESTORE, $Form1)
EndSwitch
WEnd
Func LaunchForm2()
$Form2 = GUICreate("Form2", 242, 146, 556, 300, -1, -1, $Form1)
GUISetState(@SW_SHOW, $Form2)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
GUIDelete($Form2)
ExitLoop
EndSwitch
WEnd
EndFunc
其实,这样做的话,加不加父窗口的句柄都无所谓。 |