#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <Timers.au3>
#include <GuiStatusBar.au3>
#include <ProgressConstants.au3>
Opt("MustDeclareVars", 1)
Global $hStatusBar
_Example_CallBack()
Func _Example_CallBack()
Local $hGUI
$hGUI = GUICreate("Timers Using CallBack Function(s)", 400, 320)
$hStatusBar = _GUICtrlStatusBar_Create($hGUI, 75,300,-1)
_GUICtrlStatusBar_SetText($hStatusBar, "Timers")
_GUICtrlStatusBar_SetText($hStatusBar, @TAB & @TAB & StringFormat("%02d:%02d:%02d", @HOUR, @MIN, @SEC), 0)
GUISetState()
_Timer_SetTimer($hGUI, 1000, "_UpdateStatusBarClock") ; create timer
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
EndSwitch
WEnd
_Timer_KillAllTimers($hGUI)
GUIDelete()
EndFunc ;==>_Example_CallBack
; call back function
Func _UpdateStatusBarClock($hWnd, $Msg, $iIDTimer, $dwTime)
#forceref $hWnd, $Msg, $iIDTimer, $dwTime
_GUICtrlStatusBar_SetText($hStatusBar, @TAB & @TAB & StringFormat("%02d:%02d:%02d", @HOUR, @MIN, @SEC), 0)
EndFunc ;==>_UpdateStatusBarClock
|