Rishav Posted March 20, 2009 Posted March 20, 2009 (edited) hi folksI was just wondering if we have something like "ControlWaitDisable" in Autoit.Basically I have a .Net window which contains two buttons; "Apply" and "Close"I need to click Apply. After some seconds the Apply button becomes disabled (meaning that the UI operation was done). Now I have to click Close.Currently I am using ;ControlClick (on Apply)Sleep (5 sec)Control (on Close)which is rather inelegant.any suggestions?regardsRishavEDIT: just occurred to me that maybe I can get this done using a while loop with _GUICtrlButton_GetState($hWnd). still it would be nice to know if there is a direct command for this. Edited March 20, 2009 by Rishav
BinaryBrother Posted March 20, 2009 Posted March 20, 2009 (edited) Sorta pulled that out of a bag of tricks... May or may not work, let me know... ControlClick (on Apply) ControlWaitDisabled("VB Window","[CLASS:Apply]") ControlClick (on Close) Func ControlWaitDisabled($WindowName,$ControlID) While ControlCommand($WindowName, "", $ControlID, "IsEnabled", "") Sleep(1000) WEnd EndFunc Edited March 20, 2009 by BinaryBrother SIGNATURE_0X800007D NOT FOUND
Rishav Posted March 20, 2009 Author Posted March 20, 2009 now i feel so retarded. thanks for the reply BB. thats a neat little piece of code. boy o boy, i really need to learn how to code efficiently
BinaryBrother Posted March 20, 2009 Posted March 20, 2009 (edited) Hell, I wasn't using control clicks until a couple months ago... I've been at AutoIt for about 3 years now... But I'm a slow learner... Edit: AutoIt has the best written documentation of any language I've ever seen... +1 to the help-file... lol Edited March 20, 2009 by BinaryBrother SIGNATURE_0X800007D NOT FOUND
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