Jump to content

Recommended Posts

Posted

Hi,

I'm trying to create counter for my tool which will start counting when some action starts. It's format should be 00:00:00. I have no idea how to start with this, so can somebody help me with it. Only thing I figured is that I need to use AdlibEnable. Thanks in advance for any help.

Cheers ;)

Posted

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

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
  • Recently Browsing   0 members

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