Jump to content

Reffering to more than one window in one IF statement


 Share

Recommended Posts

Heres the code

While 1

If WinExists("Kalkylatorn") Then 
    WinClose("Kalkylatorn")
    MsgBox( 0, "No", "This program is not supposed to execute" )
EndIf

If WinExists("Kalkylatorn2") Then 
    WinClose("Kalkylatorn2")
    MsgBox( 0, "No", "Neither this program is supposed to execute" )
EndIf

Sleep (200)

Wend

Is it possible to refer to more than one program in ONE if like this? Example:

If WinExists("Kalkylatorn" "Kalkylatorn2") Then 
    WinClose("Kalkylatorn" "Kalkylatorn2")
    MsgBox( 0, "No", "This program is not supposed to execute" )
EndIf

I know this is not the right method, but you get the picture, right? :lmao:

Link to comment
Share on other sites

  • Moderators

WinExists("Kalkylatorn") Or WinExists("Kalkylatorn2")

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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