Sign in to follow this  
Followers 0
burners

Checking if multiple specified process or windows exist

5 posts in this topic

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

Share this post


Link to post
Share on other sites



You could play a bit with "WinList" and the array returned.

You can easily check the array for matches.


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
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

Share this post


Link to post
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

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  
Followers 0