ForsakenGod Posted April 4, 2010 Share Posted April 4, 2010 (edited) Hello , I d like to ask if its possible to do the following : Lets say i have my program that does somethink and i want to run this program 2 times on 2 windows with sure they will have different handles but i d like to ask how to get handles of both windows if they have same name? Thank you ! Edited April 4, 2010 by ForsakenGod Link to comment Share on other sites More sharing options...
JohnOne Posted April 4, 2010 Share Posted April 4, 2010 WinList() AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
z0mgItsJohn Posted April 4, 2010 Share Posted April 4, 2010 Here's a little example code I put together : ShellExecute ('Notepad'); Run 1st notepad. ProcessWait ('Notepad.exe'); Wait till its opened. ShellExecute ('Notepad'); Run 2nd notepad. Sleep (1000); Wait till 2nd notepad is open. $HWnDs = _WinGetMultiHWnDs ('Untitled - Notepad'); Get handles of all windows titled "Untitled - Notepad" ConsoleWrite ('Windows Found : ' & $HWnDs[0] & @CRLF); $HWnDs[0] returns the amout of windows found. For $A = 1 To $HWnDs[0] ConsoleWrite (WinGetTitle ($HWnDs[$A]) & ' - ' & $HWnDs[$A] & @CRLF); Display the results. Next Func _WinGetMultiHWnDs ($Title) $List = WinList ($Title) Local $Return[$List[0][0] + 1] $Return[0] = $List[0][0] For $A = 1 To $List[0][0] $Return[$A] = $List[$A][1] Next Return $Return EndFunc Hope this helps! - John Latest Projects :- New & Improved TCP Chat Link to comment Share on other sites More sharing options...
ForsakenGod Posted April 4, 2010 Author Share Posted April 4, 2010 Thank youuu ! this is perfect Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now