#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 181, 87, 192, 114)
$Button1 = GUICtrlCreateButton("安装", 0, 32, 75, 25)
$Button2 = GUICtrlCreateButton("退出", 88, 32, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
GUISetState ()
Global $time = 5
AdlibRegister("_timer", 1000)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE, $button2
Exit
Case $button1
Case $GUI_EVENT_PRIMARYDOWN
AdlibUnRegister()
EndSwitch
If $time <= 0 Then
AdlibUnRegister()
Exit
EndIf
WEnd
AdlibUnRegister()
Exit
Func _timer()
$time -= 1
GUICtrlSetData($button2,"退出 (" & $time & ")")
If $time <= 0 Then AdlibUnRegister()
EndFunc ;==>_timer
|