Hilfe Code geht bei Win7 nicht!

06/25/2011 15:14 Vierus.exe#1
Hallo Jungs
habe ein fertigen Code der auch auf XP läuft aber auf Win7 nicht.
Hab schon alles Versucht aber ohne erfolg hatt noch einer ne Idee?
die ImageSearchDLL.dll ist im Skript dir und im WIN/System32 ordner, UAC ist aus.
Code:
#include <imagesearch.au3>
#RequireAdmin
Dim $Bild[6]
$Bild[0] = 5
$Bild[1] = "1.bmp"
$Bild[2] = "2.bmp"
$Bild[3] = "3.bmp"
$Bild[4] = "4.bmp"
$Bild[5] = "5.bmp"

$x1=0
$y1=0
$result = _WaitForImagesSearch($Bild,1,1,$x1,$y1,0)

If $result = 0 Then 
	MsgBox(0,"Keine Bilder", "Die Bilder wurden nicht gefunden")
	ProcessClose("****.exe")
    Exit
EndIf

TrayTip("Bild Nummer", $result & " gefunden", 10, 1)
Sleep(5000)


Global $buttonarray[6] = ['5', '1', '2', '3', '4', '5']



	For  $i = $result to $buttonarray[0]
		If ControlCommand('', '', $buttonarray[$i], 'IsVisible', '') Then
			ControlClick('', '', $buttonarray[$i])
		Else
			ExitLoop
		EndIf
		TrayTip("Drücke den Button", $buttonarray[$i], 10, 1)
		Sleep(5000)
		
Next
Exit
Mfg
Vierus
06/25/2011 19:13 ~De@dly Silence~#2
Falls es Win7 x64 ist, deaktiviere die native x64-Unterstützung von AutoIt oder compile das Programm als x86-Version.
06/25/2011 19:23 Vierus.exe#3
Nein es ist kein 64Bit, aber wenn ich mit den Tolleranzen rum spiele bekomme ich ein Bild gemeldet aber es ist das falsche :mad: selbst bei Tolleranz 1.
Hab auch schon die Bilder neu aufgenommen und als 256.bmp gespeichert aber ohne erfolg, welche Bilder nimmt der Befehl Imagesearch eigentlich an?
Hmmm
Bloß weil ich das geändert hab:
$result = _WaitForImagesSearch(@ScriptDir&$Bild,1,1,$x1,$y1, 0)
hab ich diese Fehler Meldung:
C:\Program Files\AutoIt3\Include\imagesearch.au3 (113) : ==> Subscript used with non-Array variable.:
for $i = 1 to $findImage[0]
for $i = 1 to $findImage^ ERROR
>Exit code: 1 Time: 15.175
MfG Vierus
06/25/2011 20:54 Vierus.exe#4
Hmm der findet überhaupt nix beim Testen mit Anderen Bildern geht es auch nicht!

Das Test Skript von AutoIt Forum:
Code:
#include <WinAPI.au3> 
	Global Const $DONT_RESOLVE_DLL_REFERENCES = 0x00000001 
	Global $hDll 
	$hDll = _WinAPI_LoadLibraryEx('ImageSearchDLL.dll', $DONT_RESOLVE_DLL_REFERENCES) 
	ConsoleWrite($hDll & @LF)

$hDll = DllOpen('ImageSearchDLL.dll') 
ConsoleWrite('@error: ' & @error & @TAB & '$hDll: ' & $hDll & @LF) 

; Replace the last parameter to the real path and image file name. 
$result = DllCall("ImageSearchDLL.dll", "str", "ImageSearch", "int", _
0, "int", 0, "int", @DesktopWidth, "int", @DesktopHeight, "str", 'C:\test.bmp') 
ConsoleWrite(@error & @LF) 
If IsArray($result) Then     
	For $i = 0 To 5         
		ConsoleWrite($result[$i] & @LF)     
	Next 
Else     
	ConsoleWrite('$result is not an array type' & @LF) 
EndIf
If $hDll <> -1 Then 
	DllClose($hDll)
EndIf
gibt folgendes aus:
0x10000000
@error: 0 $hDll: 1

Was heißt das nun? (Das die DLL und Das bild Exestieren?)

:handsdown:Help:handsdown:
06/26/2011 19:40 Vierus.exe#5
-Push-