Opt('PixelCoordMode', 2)
Opt('MouseCoordMode', 2)
;англ.справка:
Global $sTitle = '[Title:AutoIt Help; Class:HH Parent]', $iChecksum, $hWin, $iCount, _
$iLeft = 100, $iTop = 100, $iRight = 200, $iBottom = 200
HotKeySet('{Esc}', '_Exit')
If WinExists($sTitle) Then
$hWin = WinGetHandle($sTitle)
If Not WinActive($hWin) Then
WinActivate($hWin)
WinWaitActive($hWin)
EndIf
ToolTip('Контролируем изменение цвета здесь:', 0, 0)
$aMousePos = MouseGetPos()
MouseMove($iLeft, $iTop, 0)
MouseMove($iRight, $iTop)
MouseMove($iRight, $iBottom)
MouseMove($iLeft, $iBottom)
MouseMove($iLeft, $iTop)
MouseMove($aMousePos[0], $aMousePos[1], 0)
ToolTip('')
AdlibRegister('_My_PixelChecksum', 500)
Else
MsgBox(16, 'Error', 'Нет окна')
Exit
EndIf
While 1
Sleep(50)
WEnd
Func _My_PixelChecksum()
Local $i_Checksum_New
If WinExists($hWin) And WinActive($hWin) Then
If Not $iChecksum Then
$iChecksum = PixelChecksum($iLeft, $iTop, $iRight, $iBottom, 1, $hWin)
EndIf
$i_Checksum_New = PixelChecksum($iLeft, $iTop, $iRight, $iBottom, 1, $hWin)
If $iChecksum <> $i_Checksum_New Then
$iCount += 1
ToolTip('Цвет изменился ' & $iCount, 0, 0);Или делайте то, что Вам надо.
$iChecksum = $i_Checksum_New
EndIf
EndIf
EndFunc ;==>_My_PixelChecksum
Func _Exit()
Exit
EndFunc ;==>_Exit