Hi there everybody,
I was just wondering about something that has to do with pids and handles. I try to get the handle of a window of which I already have the pid as returned by RUN. Now, I try to find the handle of iexplorer.exe window that I just opened with RUN. I found some nice things on the forum (using WinList and WinGetProcess together) and they work fine untill I have two different iexplorer.exe processes running at the same time. So I wondered what was wrong and found out that they
I use this function to get all window titles or handles from one PID.
#include <Array.au3>
Opt("WinTitleMatchMode", 2)
Local $PID = ProcessExists("iexplore.exe")
If $PID = 0 Then
$PID = Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe")
EndIf
WinWait("Internet Explorer")
Local $aTitle = _PID2WinTitle($PID)
_ArrayDisplay($aTitle)
Func _PID2WinTitle($PID)
;funkey 1st Nov 2008
Local $aWinTitle[1] = [0], $List = WinList()
For $i = 1 To $List[0][0]
If $PID = WinGetProcess(