cmwalolo Posted February 25, 2008 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
rasim Posted February 25, 2008 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
cmwalolo Posted February 25, 2008 Author 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
rasim Posted February 25, 2008 Posted February 25, 2008 cmwalolo said: $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()
cmwalolo Posted February 25, 2008 Author Posted February 25, 2008 rasim said: See in the help file ControlGetHandle()Oki, but it seems that is not working with the .NET applications. Any Idea ?
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