AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Cycling through all windows that match WinTitle

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
areebb



Joined: 13 Feb 2008
Posts: 7

PostPosted: Fri Jun 13, 2008 7:58 am    Post subject: Cycling through all windows that match WinTitle Reply with quote

Hey guys,

I've been on this forum a couple times before and have received amazing help so I'm hoping for one more.

Here's my script which sends the "n" key to any internet explorer windows that ask to be closed:

Code:
SetTitleMatchMode, 2
WinWait, Internet Explorer,, 60
IfWinNotActive, Internet Explorer, , WinActivate, Internet Explorer,
WinWaitActive, Internet Explorer,, 60
WinGetText, OutputVar
Sleep, 100
IfInString, OutputVar, close this window
{
    Send, n
}


The window has the title "Internet Explorer" and nothing else. So I have to identify it by the WinGetText. Now the problem is, many times people have another instance of Internet Explorer running which matches the same title but does not have that text. Can I cycle through all these windows to find the one that has the text in it, and send the n key? It should be possible...

Thanks in advance.
-Areeb
_________________
Areeb Bajwa
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6847
Location: Pacific Northwest, US

PostPosted: Fri Jun 13, 2008 5:21 pm    Post subject: Reply with quote

you can use WinGet, (List option) to list all IE windows by window ID, then cycle through those using Loop.

you can even use WinGet, List to filter for WinText and Wintitle at the same time.
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group