Func _SearchPix($x1, $y1, $x2, $y2, $color, $shvar=0, $step=1, $hWnd = 0, $withoutFocus=-1)
if Not $hWnd Then $hWnd = _findCurWindowHandle()
if $withoutFocus == -1 Then $withoutFocus = get_WithoutFocusMode()
$hWnd = WinGetHandle($hWnd)
Local $Size[2] = [$x2 - $x1, $y2 - $y1]
Local $hDC = _WinAPI_GetDC($hWnd)
Local $hMemDC = _WinAPI_CreateCompatibleDC($hDC)
Local $hBitmap = _WinAPI_CreateCompatibleBitmap($hDC, $Size[0], $Size[1])
Local $hSv = _WinAPI_SelectObject($hMemDC, $hBitmap)
_WinAPI_BitBlt($hMemDC, 0, 0, $Size[0], $Size[1], $hDC, $x1, $y1, $SRCCOPY)
_WinAPI_SelectObject($hMemDC, $hSv)
_WinAPI_DeleteDC($hMemDC)
_WinAPI_ReleaseDC($hWnd, $hDC)
_PaintBitMap($Size, $hBitmap)
;----------------------------------------
sleep(5000)
Exit
EndFunc