Jump to content

ControlWaitDisble [SOLVED]


Recommended Posts

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
Link to comment
Share on other sites

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

SIGNATURE_0X800007D NOT FOUND

Link to comment
Share on other sites

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

SIGNATURE_0X800007D NOT FOUND

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...