Func _SearchPix($x1, $y1, $x2, $y2, $coll, $shvar=0, $step=1)
$ARGB = _WinAPI_IntToDWord(BitOR($coll, 0xFF000000))
$Size = WinGetClientSize($hWnd)
$L1 = $Size[0]*($y1-1)+$x1
$L2 = $Size[0]*($y2-1)+$x2
$L = $Size[0] * $Size[1]
$tBits = DllStructCreate('dword[' & $L & ']')
_WinAPI_GetBitmapBits($hBMP, 4 * $L, DllStructGetPtr($tBits))
$Offset = -1
For $i = $L1 To $L2 Step $step
If DllStructGetData($tBits, 1, $i) = $ARGB Then
$Offset = $i
ExitLoop
EndIf
Next
If $Offset = -1 Then
Return SetError(1)
Else
$x = Mod($Offset, $Size[0]) - 1
$y = Ceiling($Offset / $Size[0]) - 1
Local $coor[2] = [$x, $y]
Return $coor
EndIf
EndFunc