cmwalolo Posted February 25, 2008 Share Posted February 25, 2008 I'm looking for a tool that could measure time used to do some actions within multiple windows forms. I can't read in the documentation if there is some code to get some nice interaction between the current GUI and the action that need to be taken. By example I have a form with two buttons... One is enabled, another is disabled. When I push the first button, after a certain time of processing, the second button is enabled and it should be pushed. Is there some sample script somewhere that deals with such things, other then putting delays ... ? Thanks for any help, Laurent Link to comment Share on other sites More sharing options...
rasim Posted February 25, 2008 Share Posted February 25, 2008 Welcome! Try this: #include <GUIConstants.au3> $hGui = GUICreate("Test GUI", 160, 50) $button1 = GUICtrlCreateButton("Button1", 10, 10, 50, 25) $button2 = GUICtrlCreateButton("Button2", 100, 10, 50, 25) GUICtrlSetState(-1, $GUI_DISABLE) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $button1 Sleep(1000) GUICtrlSetState($button2, $GUI_ENABLE) ControlClick($hGui, "", $button2) Case $button2 MsgBox(0, "Msg", "Button 2 clicked") EndSwitch WEnd Link to comment Share on other sites More sharing options...
cmwalolo Posted February 25, 2008 Author Share Posted February 25, 2008 $button1 = GUICtrlCreateButton("Button1", 10, 10, 50, 25) It looks cool... But how can I do the same with controls that are not created within the script ? Isn't there a function to get some control ? If see GUICtrlGetHandle ( controlID ), but no parameter for the Window that contains the control. Thank you Laurent Link to comment Share on other sites More sharing options...
rasim Posted February 25, 2008 Share Posted February 25, 2008 $button1 = GUICtrlCreateButton("Button1", 10, 10, 50, 25)It looks cool... But how can I do the same with controls that are not created within the script ?Isn't there a function to get some control ?If see GUICtrlGetHandle ( controlID ), but no parameter for the Window that contains the control. Thank youLaurentSee in the help file ControlGetHandle() Link to comment Share on other sites More sharing options...
cmwalolo Posted February 25, 2008 Author Share Posted February 25, 2008 See in the help file ControlGetHandle()Oki, but it seems that is not working with the .NET applications. Any Idea ? 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