Jump to content

If a specific window exists at any time during the script?


Recommended Posts

How can I look for a specific window to appear at any time during the script?

I my example, the AutoPlay window might pop up at any time during my script and I would like to minimize it if it does. I know that

If WinExists("AutoPlay") Then WinSetState("AutoPlay","",@SW_HIDE)
would do the trick, but is there a way to get this to run throughout the duration of the AutoIt script (without just pasting it in every other line)?

Thanks,

Ari

Link to comment
Share on other sites

AdlibRegister("_HideWindow")

Func _HideWindow()
    If WinExists("AutoPlay") Then
        WinSetState("AutoPlay", "", @SW_HIDE)
    EndIf
EndFunc

Read about AdlibRegister in the helpfile before using it.

This is just one way of doing it, there are others such as just adding the function in your script loop.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

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...