Sign in to follow this  
Followers 0
Trojan55

Getting middle color of a window

4 posts in this topic

#1 ·  Posted (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 by Trojan55

Share this post


Link to post
Share on other sites



without activate the window?


Share this post


Link to post
Share on other sites

#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)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0