本帖最后由 tzz365 于 2010-3-5 16:48 编辑
第二个GUI你好世界。
点取消, 不关闭倒计时。 只退出第二个GUI如何做到。$Label1 = GUICtrlCreateLabel("30秒后机器重启进入超级状态!", 1, 50, 400, 28)
GUICtrlSetFont(-1, 12, 400, 0, "楷体_GB2312")
$Progress1 = GUICtrlCreateProgress(8, 88, 333, 17)
$Button1 = GUICtrlCreateButton("确定(&Y)", 53, 128, 73, 25, 0)
$Button2 = GUICtrlCreateButton("退出(&X)", 210, 128, 73, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
AdlibRegister("_timer", 1000)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE, $Button2
Exit
Case $Button1
GUICreate("你好世界", 200, 100)
GUICtrlCreateLabel("你好世界!你好么?", 30, 10)
$okbutton1 = GUICtrlCreateButton("取消", 20, 50, 60)
$okbutton2 = GUICtrlCreateButton("确定", 120, 50, 60)
GUISetState(@SW_SHOW)
While 1
$msg = GUIGetMsg()
Select
Case $msg = $okbutton1
exit(0)
Case $msg = $okbutton2
$okbutton2 = $Button1
ExitLoop
EndSelect
WEnd
ExitLoop
exit
EndSwitch
If $time <= 0 Then ExitLoop
WEnd
main()
Exit
Func _timer()
$time -= 1
GUICtrlSetData($Label1, $time & "秒后机器重启进入超级状态!")
GUICtrlSetData($Progress1, (30 - $time) / 0.3)
If $time <= 0 Then AdlibUnRegister()
EndFunc ;==>_timer
Func main()
Run("D:\Program Files\Tencent\QQ\Bin\QQ.exe");启动qq
EndFunc ;==>main
|