前两天刚好帮人解决了这类问题#include <GUIConstantsEx.au3>
Dim $timez = 10, $time = $timez
$Form1 = GUICreate("安装倒计时窗口", 350, 172, 193, 125)
$Label1 = GUICtrlCreateLabel($time & "秒后将安装xxx,请选择!", 20, 32, 310, 28, 0x0002)
GUICtrlSetFont(-1, 16, 400, 0, "楷体_GB2312")
$Progress1 = GUICtrlCreateProgress(8, 88, 333, 17)
$Button1 = GUICtrlCreateButton("立即进入(&Y)", 53, 128, 90, 25)
$Button2 = GUICtrlCreateButton("退出安装(&X)", 210, 128, 90, 25)
GUISetState()
AdlibEnable("_timer", 1000)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE, $Button2
Exit
Case $Button1
ExitLoop
EndSwitch
If $time <= 0 Then ExitLoop (Sleep(1000))
WEnd
main()
Func _timer()
$time -= 1
GUICtrlSetData($Label1, $time & "秒后将安装xxx,请选择!")
GUICtrlSetData($Progress1, ($timez - $time) / $timez * 100)
If $time <= 0 Then Return (GUICtrlSetData($Label1, "现在开始安装xxx ")) & (AdlibDisable())
EndFunc ;==>_timer
Func main()
MsgBox(0, 'test', '倒计时结束,进入主程序.', 2)
;Run("xxx安装.exe")
EndFunc ;==>main
|