Hollowyearz

IsPressed - PixelGetColor

Feb 1st, 2014
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.43 KB | None | 0 0
  1. ; ispressed  - Spacebar
  2. ;  returns color of center of named window
  3.  
  4. #include <Misc.au3>
  5. Local $hDLL = DllOpen("user32.dll")
  6.  
  7. While 1
  8.     If _IsPressed("20", $hDLL) Then
  9.         $hWnd = WinGetHandle("AutoIt Help")  ; change to your window
  10.         $Pos = WinGetPos($hWnd)
  11.         $Color = PixelGetColor($Pos[0] / 2, $Pos[1] / 2)
  12.  
  13.         MsgBox(0, "", $Pos[0] & "," & $Pos[1] & @CRLF & "0x" & Hex($Color, 6))
  14.  
  15.     EndIf
  16.     Sleep(250)
  17. WEnd
  18.  
  19. DllClose($hDLL)
Advertisement
Add Comment
Please, Sign In to add comment