#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Timers.au3>
$Window = GUICreate("工具将在以下时间刷新", 340, 194, 458, 25)
$Button = GUICtrlCreateButton("点击暂停(秒)(10)", 40, 100,270,40)
GUISetState(@SW_SHOW)
Global $Check = 10
While 1
$Msg = GUIGetMsg()
Switch $Msg
Case $GUI_EVENT_CLOSE
Exit
Case $Button
If GUICtrlRead($Button) = "点击暂停(秒)(10)" Then
$Timer = _Timer_SetTimer($Window, 1000, "update")
Else
_Timer_KillTimer($Window, $Timer)
GUICtrlSetData($Button,"点击暂停(秒)(10)")
$Check = 10
EndIf
EndSwitch
Sleep(100)
WEnd
Func update($hWnd, $Msg, $iIDTimer, $dwTime)
$Check -= 1
GUICtrlSetData($Button, "点击暂停(" & $Check & ")"&"秒")
If $Check = 0 Then
_Timer_KillTimer($Window, $Timer)
GUICtrlSetData($Button,"点击暂停(秒)(10)")
$Check = 10
;以下写你的
;Run( @ScriptDir & "\sm32Xtest_V06-7.exe")
;WinWaitActive("SMI Mass Production Tool","Factory Driver and HUB")
;Send("{F5}")
$Timer = _Timer_SetTimer($Window, 1000, "update")
EndIf
EndFunc ;==>update
|