#include "BmpSearch.au3"
#include <ScreenCapture.au3>
#Include <WinAPI.au3>
#include <Constants.au3>
_GDIPlus_Startup()
$win = 'Ограничение Demo-версии'
Global $numbers[2][4];
Global $j =0
WinWaitActive('Ограничение Demo-версии')
For $i = 1 To 9 Step +1
$hSource = _ScreenCapture_CaptureWnd ('', WinGetHandle ($win))
$hBmp = _GDIPlus_BitmapCreateFromFile(@ScriptDir&'\'&$i&'.bmp')
$hFind = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBmp)
;ConsoleWrite ('5'&@CRLF)
$aCoords = _BmpSearch($hSource, $hFind, 1)
If @error Then
ConsoleWrite("не найдено" & @CRLF)
Else
$x = $aCoords[1][2]
$y = $aCoords[1][3]
$numbers[0][$j] = $x
$numbers[1][$j] = $y
$j+=1
ConsoleWrite('найдено ' & @CRLF)
EndIf
_WinAPI_DeleteObject($hSource)
_WinAPI_DeleteObject($hFind)
Next
$winPos = WinGetPos($win)
For $i = 0 To 3 Step +1
$xPoint = $winPos[0]+$numbers[0][$i]
$yPoint = $winPos[1]+$numbers[1][$i]
ConsoleWrite('x= '&$xPoint & @CRLF)
ConsoleWrite('y= '&$yPoint & @CRLF)
;_WinAPI_Mouse_Event(BitOR($MOUSEEVENTF_MOVE, $MOUSEEVENTF_ABSOLUTE) , $xPoint , $yPoint )
MouseMove( $xPoint,$yPoint,0) ;$numbers[0][0], $numbers[0][1])
MouseDown("left")
Next
MouseUp("left")
MsgBox(4096, "Done", "all dOne")