Sign in to follow this  
Followers 0
Wberg

If window is not active then exitloop, need help

2 posts in this topic

I use AutoIt to run som scripts in explorer... the title of the window is "ikarim" which i use in the begining with WinActivate("Ikariam")

But i was wondering what to do if i want the script to pause if i manually unfocus ikariam...

Thnx in advance >_<

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

While 1
    If WinActive("ikarim") = 0 Then ;0 means the window is not active, check the helpfile for the return values of each function.
        Do
            Sleep(50)
        Until WinActive("ikarim") = 1
    EndIf
WEnd

This will pause your script if the window "ikarim" is not active.

Less Sleep() value means more CPU usage as far as I know.

Edited by Info

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