Trojan55 Posted February 1, 2014 Posted February 1, 2014 (edited) Hello All here is my code can anyone please help me? If _IsPressed("20") Then $Pos = WinGetPos("Window") $Color = pixelgetcolor($Pos[0]/2,$Pos[1]/2) MsgBox(0,"",$Pos[0]&","&$Pos[1]&@CRLF&"0x"&Hex($Color,6)) EndIf I'm trying to get middle color of window but pixelgetcolor still don't get the middle... anyone to help? Edited February 1, 2014 by Trojan55
l3ill Posted February 1, 2014 Posted February 1, 2014 #include <Misc.au3> Local $hDLL = DllOpen("user32.dll") While 1 If _IsPressed("20", $hDLL) Then $hWnd = WinGetHandle("AutoIt Help") ; change to your window $Pos = WinGetPos($hWnd) $Color = PixelGetColor($Pos[0] / 2, $Pos[1] / 2) MsgBox(0, "", $Pos[0] & "," & $Pos[1] & @CRLF & "0x" & Hex($Color, 6)) EndIf Sleep(250) WEnd DllClose($hDLL) My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example
l3ill Posted February 1, 2014 Posted February 1, 2014 Actually that would be wrong. If you want the center of the window you will need to divide the width and height by 2 which would be #2 and #3 in the array My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now