Jump to content

Recommended Posts

Posted

Hey, I need help here.

I am trying to check and see if a certain window exists, if not, run the program so that the window will existif it does, continue with checking if the window is active. Then I want to check if the window is active, if it is, keep running the script. If it isnt, activate the window.

Any ideas?

Posted

Nevermind, I figured it out.

; Check if window exists.
    If NOT WinExists ("DarkWars", "") Then
    ; BROWSER CHECK: If user doesn't have FireFox, use Internet Explorer.
        If FileExists(@ProgramFilesDir & "\Mozilla Firefox\firefox.exe") Then
            Run(@ProgramFilesDir & "\Mozilla Firefox\firefox.exe " & $URL )
        ElseIf FileExists(@ProgramFilesDir & "\Internet Explorer\iexplore.exe") Then
            Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe " & $URL )
        EndIf
    ElseIf WinExists ("DarkWars", "") Then
    ; Check if window is active.
        If Not WinActive("DarkWars") Then
            WinSetState("DarkWars", "", @SW_SHOW)
        Endif
    ; Continue on with script.
    ; Continue on with script.
    ; Continue on with script.
    ; Continue on with script.
    EndIf

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...