Sign in to follow this  
Followers 0
Rishav

ControlWaitDisble [SOLVED]

4 posts in this topic

#1 ·  Posted (edited)

hi folks

I 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?

regards

Rishav

EDIT: 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 by Rishav

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Sorta pulled that out of a bag of tricks... May or may not work, let me know... :P

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 by BinaryBrother

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Hell, I wasn't using control clicks until a couple months ago... I've been at AutoIt for about 3 years now... :unsure:

But I'm a slow learner... :P

Edit: AutoIt has the best written documentation of any language I've ever seen... +1 to the help-file... lol

Edited by BinaryBrother

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  
Followers 0