Jump to content
Sign in to follow this  

OnEvent functions design

Recommended Posts


How are designed functions like GUICtrlSetOnEvent()? For example I want to create a function to update a control when system time is changed. Well this is quite simple even with AdlibRegister but would be nice to have a function to react just when time has been changed, not keep call a function 10 times/sec to see when the time is changed.

An example using AdlibRegister:


$hMain = GUICreate("OnTimeChange",200,30)
$hCtrl = GUICtrlCreateLabel("",0,0,200,30,0x01)

Until GUIGetMsg() = -3

Func OnTimeChange()
    Static $Last
    Local $New = @HOUR & ":" & @MIN
    If $New <> $Last Then
        $Last = $New

I appreciate any idea. ;)

When the words fail... music speaks

Share this post

Link to post
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
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.