所以照猫画虎
#include <Date.au3>
GUICreate('', 300, 100)
GUICtrlCreateLabel('已运行:', 90, 70, 100, 15)
Dim $tl = GUICtrlCreateLabel('00:00', 140, 70, 150, 15)
GUISetState()
Dim $timer = TimerInit()
AdlibRegister('Timer', 500)
While 1
Switch GUIGetMsg()
Case -3
Exit
EndSwitch
WEnd
Func Timer()
Local $Secs, $Mins, $Hour, $Time, $ticks, $sTime
$ticks = Int(TimerDiff($timer))
_TicksToTime($ticks, $Hour, $Mins, $Secs)
$Time = StringFormat('%02s分:%02s秒', $Mins, $Secs)
If $sTime <> $Time Then GUICtrlSetData($tl, $Time)
$sTime = $Time
EndFunc ;==>Timer
|