Sign in to follow this  
Followers 0
Eli

IsEnabled checked till 0

5 posts in this topic

How would I keep checking ControlCommand($window, "", controlID, "IsEnabled", "") ?

I want to keep a GUI visible until an edit field in another program becomes disabled.

$x = ControlCommand($window, "", controlID, "IsEnabled", "")

it seems as tho If, For, and Do loops only checks it that first time

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

How would I keep checking ControlCommand($window, "", controlID, "IsEnabled", "") ?

I want to keep a GUI visible until an edit field in another program becomes disabled.

$x = ControlCommand($window, "", controlID, "IsEnabled", "")

it seems as tho If, For, and Do loops only checks it that first time

Use a while loop

While 1
$x = ControlCommand($window, "", controlID, "IsEnabled", "")
 If $x = 0 then (0 or what ever it would return I'm not sure of the value it would return without looking)
     What ever you want it to do goes here and if you want it to stop checking after this then add exitloop on the next line
     Exitloop
        Else
        Sleep (100)
  Endif
Wend
Edited by ChrisL

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Maybe

While 1
    $func1 = ControlCommand($window, "", controlID, "IsEnabled", "") 
    If $func1 = 1 Then ExitLoop
    Sleep(200)
WEnd

or

While ControlCommand($window, "", controlID, "IsEnabled", "") <> 1
   Sleep(100)
Wend

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

Maybe

While 1
    $func1 = ControlCommand($window, "", controlID, "IsEnabled", "") 
    If $func1 = 1 Then ExitLoop
    Sleep(200)
WEnd

or

While ControlCommand($window, "", controlID, "IsEnabled", "") <> 1
   Sleep(100)
Wend

8)

Oh yeah.. much more economical :P

Share this post


Link to post
Share on other sites

While IsEnabled, Sleep and loop to check again.

While ControlCommand($window, "", controlID, "IsEnabled", "")
   Sleep(100)
Wend

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