Jump to content

How to "tag" existing window

Recommended Posts


Let's asume I have x number of notepad windows with the following titles:

"abc - session - blablabla"

"def - session - blabla"

"ghi - session - bla"

I want to know how many windows exists assuming that the number of windows (x) can change?

How can I do it? This is what I have written so far.

Opt("WinTitleMatchMode", 2)


For $i=1 to 100

If WinExists ("session - ") Then

;found a window





There is no problem to check if these window exists but how to "tag" the one I have found in order not to count them again in the IF? :D


Link to comment
Share on other sites

you can change the name of each window, if you know the name, so you put the name into a variable first using something like

$name = wingetname("name")

then change the name of the window

WinSetTitle ( "title", "text", "newtitle" )

Link to comment
Share on other sites

Though about it. Can't change the name of the windows.

Why not? The idea is to change them back when you are done. The name change would occur for less than 1 second, and then you can put them back. Basic idea is like this:

Opt("WinTextMatchMode", 2);any valid substring match

$count = 0
While WinExists("search title")
  $count + $count + 1
  ReDim $TitleArray[$count];increase array for another stored title
 ;now change the title so we don't count it a 2nd time:
  WinSetTitle("search title", "", "Temporary Title " & UBound($TitleArray) - 1)
For $i = 0 To UBound($TitleArray) - 1
  WinSetTitle("Temporary Title " & $i, "", $TitleArray[$i];set title back

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

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

  • Recently Browsing   0 members

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