Jump to content

A short question


Guest Xauier
 Share

Recommended Posts

yes...

but what i need is to check it two or more windows with the same name exist!!

With you if cause it is possible to find one window with a special name.... i need to find 2..or more :ph34r:

but thx...

Link to comment
Share on other sites

Hiya,

its a bit long winded, but it works:

AutoItSetOption("WinTitleMatchMode", 4)
$windowtitle = "Explorer - "
Dim $winarr[20][2]
$counter = 0
While WinExists($windowtitle)
  $winarr[$counter][0] = "handle=" & wingethandle($windowtitle)
  $winarr[$counter][1] = wingettitle($windowtitle)
  winsettitle($windowtitle,'',"Some new title" & $counter)
  $counter = $counter + 1
WEnd

For $I = 0 to $counter-1
  winsettitle($winarr[$I][0],'',$winarr[$I][1])
Next

MsgBox(0,'',$counter)

Gives you a popup with the number of Explorers you have open.

If the windows you are searching for, really have EXACTLY the same titles, you can leave the saving of the windowtitles away.

Greetings,

ZeD

Link to comment
Share on other sites

If you use

WinSetTitle ( "your windowtitle", "your text", "new windowtitle" )
only the first window will be renamed. So you can rename your windows step by step.

Try it, open two session of notepad.exe and execute:

WinSetTitle ( "Untitled - Notepad", "", "First" )
WinSetTitle ( "Untitled - Notepad", "", "Second" )

Of course, this works only if you know the number of the windows with the same title.

Edited by Westi
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...