Jump to content

Checking if multiple specified process or windows exist


burners
 Share

Recommended Posts

I was looking for a simple way (maybe with Winexist or Processexist) to check if multiple windows of the same program are open.

The program I am checking is Putty, The process name is always putty.exe.

The Windows name is the IP of your connection and then putty, Example "192.168.1.1 - PuTTY"

I have been using the following to match the window

Opt("WinTitleMatchMode", 2)

WinWaitActive(" - PuTTY", "")

and then later

WinActivate(" - PuTTY", "")

So could I somehow look for with Winexist - PuTTY and then look again, then check to see if they match ? Or any other ideas like maybe looking at the process then find another process then see if the process ID's match.

Thanks

~~--Feel Free to Steal my Sigs --~~FLAT LOOK____________________________________ROUNDED LOOK

Link to comment
Share on other sites

OK I found it. I will play with the code once I get home tonight.

$var = WinList()

For $i = 1 to $var[0][0]
  ; Only display visble windows that have a title
  If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then
    MsgBox(0, "Details", "Title=" & $var[$i][0] & @LF & "Handle=" & $var[$i][1])
  EndIf
Next

~~--Feel Free to Steal my Sigs --~~FLAT LOOK____________________________________ROUNDED LOOK

Link to comment
Share on other sites

Dizzune to tha Bizzuns

lolz

Opt("WinTitleMatchMode", 2)
$var = WinList("PuTTY")
$wcount = 0
For $i = 1 to $var[0][0]
    $wcount = $wcount +1
Next

MsgBox(0, "Details", "Current open PuTTY Windows " & $wcount)

~~--Feel Free to Steal my Sigs --~~FLAT LOOK____________________________________ROUNDED LOOK

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