回复 7# 3mile
他不是这个意思。
是这样的。
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$main = GUICreate("MyGUI", 392, 322)
$Button_1 = GUICtrlCreateButton("Input", 140, 190, 70, 30)
$popup = GUICreate("PopUP", 191, 185, -1, -1, -1, $WS_EX_TOPMOST)
GUISetState(@SW_SHOW,$main)
GUISetState(@SW_SHOW,$popup)
While 1
$msg = GUIGetMsg(1)
Select
Case $msg[1] = $popup And $msg[0] = $GUI_EVENT_CLOSE ; 子窗口关闭,隐藏子窗口,启用主窗口并激活
GUISetState(@SW_HIDE, $popup)
WinSetState($main,"",@SW_ENABLE)
WinActivate($main)
Case $msg[1] = $main And $msg[0] = $GUI_EVENT_CLOSE ; 主窗口关闭,程序退出
If WinGetState($popup)=5 Then
ExitLoop
EndIf
Case $msg[1] = $main And $msg[0] = $Button_1 ; 点击按钮,打开子窗口。
GUISetState(@SW_SHOW, $popup)
EndSelect
If WinGetState($popup)=7 Then ;检测子窗口存在且处于非激活状态,激活。 禁用主窗口。
WinSetState($main,"",@SW_DISABLE)
WinActivate($popup)
EndIf
WEnd
|