Jump to content
Sign in to follow this  
Wberg

If window is not active then exitloop, need help

Recommended Posts

Wberg

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
Info

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.