Advertisement
Guest User

Untitled

a guest
Sep 9th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.77 KB | None | 0 0
  1.  
  2. #include <WinAPI.au3>
  3. #include <Color.au3>
  4. #include <WinAPIGdi.au3>
  5.  
  6.  
  7. Func WindowColorGet($Handle, $x, $y, $Color, $shade = 20)
  8.  
  9.     Local $GDC = _WinAPI_GetWindowDC($Handle)
  10.     $iColor = "0x" & HEX(_WinAPI_GetPixel($GDC, $x, $y))
  11.  
  12.     if IsArray(_ColorGetRGB($iColor)) and IsArray(_ColorGetRGB($Color)) Then
  13.         $RGBS = _ColorGetRGB($iColor)
  14.         $RGB = _ColorGetRGB($Color)
  15. ;~      MsgBox(0,"",$iColor)
  16.     Else
  17.         Return False
  18.     EndIf
  19.  
  20.     _WinAPI_ReleaseDC(0,$GDC)
  21.     If  Abs($RGB[0] - $RGBS[0]) <= $shade And Abs($RGB[1] - $RGBS[1]) <= $shade And Abs($RGB[2] - $RGBS[2]) <= $shade Then
  22.             Return True
  23.     EndIf
  24.     Return False
  25.  
  26.  
  27. EndFunc
  28.  
  29.  
  30. Func WindowClick($Handle,$x, $y ,$mode = "left" ,$Count = 1)
  31. ;~  $y = $y - 40
  32.     ControlClick($Handle, "", "", $mode ,$Count ,$x, $y)
  33. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement