版权pcbar所有,我只是修改了一下#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Global $time = 30 ;时间
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("所选软件安装完毕,XXXXXXXXXX,这些你自己写", 600, 172, 193, 125)
$Label1 = GUICtrlCreateLabel("30秒后将自动重启!您可以作出选择!", 56, 32, 555, 28)
GUICtrlSetFont(-1, 18, 400, 0, "楷体_GB2312")
$Progress1 = GUICtrlCreateProgress(8, 88, 555, 30)
$Button1 = GUICtrlCreateButton("立即重启(&Y)", 53, 128, 73, 25, 0)
$Button2 = GUICtrlCreateButton("稍后重启(&X)", 210, 128, 73, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
AdlibEnable("_timer", 1000)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE, $Button2
Exit
Case $Button1
ExitLoop
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 AdlibDisable()
EndFunc ;==>_timer
Func main()
MsgBox(0, 'Information', 'Time out! Restart!.', 10) ;不懂中文,写英文算了
Shutdown(2) ;重启
EndFunc ;==>main
|