Jump to content

Time Counter


igorm
 Share

Recommended Posts

igorm

#include <GUIConstants.au3>
#include <Date.au3>

Global $sTimer, $Dll_Timer, $hour, $min, $sec

$hGUI = GUICreate("Test", 150, 70, -1, -1)
$label = GUICtrlCreateLabel("00:00:00", 50, 15, 100, 20)

GUISetState()

$begin = TimerInit()
AdlibEnable("SetTime", 1000)

While 1
    Switch GUIGetMsg()
    Case -3
        ExitLoop
    EndSwitch
WEnd

Func SetTime()
    Local $time = _TicksToTime(Int(TimerDiff($begin)), $hour, $min, $sec)
    ControlSetText($hGUI, "", $label, StringFormat("%02i:%02i:%02i", $hour, $min, $sec))
EndFunc
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...