Andreik Posted May 7, 2012 Share Posted May 7, 2012 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: AdlibRegister("OnTimeChange",100) $hMain = GUICreate("OnTimeChange",200,30) $hCtrl = GUICtrlCreateLabel("",0,0,200,30,0x01) GUICtrlSetFont($hCtrl,18,700,1,"Garamond") GUISetState(@SW_SHOW,$hMain) Do Sleep(10) Until GUIGetMsg() = -3 Func OnTimeChange() Static $Last Local $New = @HOUR & ":" & @MIN If $New <> $Last Then GUICtrlSetData($hCtrl,$New) $Last = $New EndIf EndFunc I appreciate any idea. When the words fail... music speaks. Link to comment Share on other sites More sharing options...
Zedna Posted May 7, 2012 Share Posted May 7, 2012 (edited) Use GUIRegisterMsg and WM_TIMECHANGEhttp://msdn.microsoft.com/en-us/library/windows/desktop/ms725498%28v=vs.85%29.aspxEDIT: Now I see you probably didn't mean "change of system time", so my answer is not for you. Edited May 7, 2012 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now