Hallo, ich versuche über AutoIT eine RDP Session zu starten, wenn diese aufgebaut ist (login usw klappt schon) soll per Imagesearch der Startmenü button mittels eines *gif Bilds gefunden werden und danach der log off button. Mit festen punkten, welche ich dem mauszeiger gebe funktioniert es, ohne jedoch nicht. Imagesearch findet kein Bild.
Hier mal ein Teil des codes
Hier mal ein Teil des codes
Code:
Local $result = 2
Local $findStartImg = """D:\Autoit\AutoIT\w2k8-Start.gif"""
Local $findImage = """D:\Autoit\AutoIT\w2k8-Logoff.gif"""
Local $resultPosition
Local $x
Local $y
Local $tolerance = 25
ConsoleWrite("3 --- WinWait --- " & $computername & @CRLF)
For $i = 0 To 30 Step +1
ConsoleWrite("3.1 --- Before ImageSearch --- " & $computername & @CRLF)
; $result = _ImageSearchArea($findStartImg,$x,$y,5,800,75,1)
; $result = _ImageSearchArea($findStartImg,1,800,5,800,5,500,500,10)
$result = _ImageSearch($findStartImg,1,$x,$y,25)
; $result = _ImageSearch($findImage,1,$x,$y,25)
; $result = _ImageSearch($findImage,1,$x,$y,125)
ConsoleWrite("STARTx: ImageSearch RESULT LOOP-Counter: " & $i & " result: " & $result & " x: " & $x & " y: " & $y & " resultPosition:" & $resultPosition & @CRLF)
If $result = 1 Then ExitLoop
Sleep (500)
Next
;MsgBox(0, "ImageSearch RESULT", "LOOP-Counter: " & $i & " result: " & $result & " x: " & $x & " y: " & $y & " resultPosition:" &$resultPosition)