Sign in to follow this  
Followers 0
Guest Xauier

A short question

9 posts in this topic

Is it possible to make an if selection with AutiIt to search for two or more windows with the same name ??

Thx...

Share this post


Link to post
Share on other sites



Checks to see if a specified window exists.

WinExists ( "title" [, "text"] )

Share this post


Link to post
Share on other sites

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

Share this post


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

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

Yeah

thx a lot

It works very good :ph34r:

Share this post


Link to post
Share on other sites

One more question....

is there a possibility to find processes (win2k) and close them without to get a messagebox ?

Share this post


Link to post
Share on other sites

ProcessList() and ProcessClose()

Share this post


Link to post
Share on other sites

Isn't ProcessList only in unstable 3.0.103? You should make that clear before suggesting it to newbies... that can get them all screwed up... lol. :ph34r:

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