Guten Abend AutoIt'ler
Ich habe ein kleines Problem mit "_IEAttach".
Spoiler anzeigen
$oIe = Attach()
Func Attach()
$Check = 0
Do
$IePid = ProcessExists("iexplore.exe")
If $IePid Then
$oIe = _IEAttach(GetWinHandleByPID($IePid), "HWND")
If $oIe Then $Check = 1
EndIf
Until $Check
Return ($oIe)
EndFunc ;==>Attach
Func GetWinHandleByPID($PID)
$wList = WinList()
For $i = 1 To $wList[0][0]
If IsVisible($wList[$i][1]) Then
If WinGetProcess($wList[$i][0]) = $PID Then
Return ($wList[$i][1])
EndIf
EndIf
Next
Return (0)
EndFunc ;==>GetWinHandleByPID
Func IsVisible($handle)
If BitAND(WinGetState($handle), 2) Then
Return 1
Else
Return 0
EndIf
EndFunc ;==>IsVisible
Immer wenn ich dieses Script ausführe, bekomme ich folgenden Fehler:
==> The requested action with this object has failed.:
Return HWnd($o_object.HWnd())
Return HWnd($o_object.HWnd()^ ERROR
Ich habe auch schon direkt WinGetHandle mit meiner etwas frieseligeren "WinGetHandleByPID" Version verglichen: Beides das gleiche Ergebnis. Also kann es am Handle eig. nicht liegen.
Wüsste vllt jemand Rat?
Vielen Dank im Voraus, LG,
Lenny