Oki, hat soweit geklappt. Nur wollte ich das gern in eine UI einbauen, weiß aber nicht, wo welcher Code hin muss???
Code:
#include<ImageSearch.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=C:\Users\Stephan\Desktop\Form2.kxf
$Form2 = GUICreate("Form2", 235, 217, 311, 210)
$START = GUICtrlCreateButton("START", 0, 72, 233, 129)
$Label1 = GUICtrlCreateLabel("Drücke auf Start", 0, 48, 227, 17)
$Label2 = GUICtrlCreateLabel("Test", 48, 0, 140, 41)
GUICtrlSetFont(-1, 24, 400, 4, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$x1=0
$y1=0
$result = _ImageSearch("xy.png",1,$x1,$y1,0)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $START
if $result=1 Then
MsgBox(0,"Gefunden!","Das angegebene Bild wurde gefunden!")
EndIf
EndSwitch
WEnd
EDIT:
Oki, hat sich auch von alleine erledigt, einafch alles da rein:
Code:
#include<ImageSearch.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=C:\Users\Stephan\Desktop\Form2.kxf
$Form2 = GUICreate("Form2", 235, 217, 311, 210)
$START = GUICtrlCreateButton("START", 0, 72, 233, 129)
$Label1 = GUICtrlCreateLabel("Drücke auf Start", 0, 48, 227, 17)
$Label2 = GUICtrlCreateLabel("Test", 48, 0, 140, 41)
GUICtrlSetFont(-1, 24, 400, 4, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $START
$x1=0
$y1=0
$result = _ImageSearch("xy.png",1,$x1,$y1,0)
if $result=1 Then
MsgBox(0,"Gefunden!","Das angegebene Bild wurde gefunden!")
EndIf
EndSwitch
WEnd