boxme

PixelGetColor Not Working Correctly with Aero turned Off

8 posts in this topic

I am using PixelGetColor to find the color under the mouse cursor in the currently active window. With Windows Aero turned on the PixelGetColor works perfectly. If I turn off Windows Aero PixelGetColor does not return the color of the active window but rather the color of the window directly below it. This problem also appears to only happen if certain applications are the active window. Has anyone experienced anything like this? 

Share this post


Link to post
Share on other sites



I wonder if it has to do with composition and the video memory handling.  I never heard of this before.  But I know with Vista the way video memory was used for window painting etc. changed.  Perhaps dwm.exe handles that chore.

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I wonder if it has to do with composition and the video memory handling.  I never heard of this before.  But I know with Vista the way video memory was used for window painting etc. changed.  Perhaps dwm.exe handles that chore.

 

Thanks, I'll try looking into Windows Desktop Manager and see if I can find anything about this. I've also observed that this problem only exists for some applications, in Google Chrome for example PixelGetColor works fine with Aero off. I've come across a lot of old threads saying applications that use DirectX have this same problem of getting the color of background windows, no of Aero though. The application I'm trying to use PixelGetColor on does use DirectX. 

Edited by boxme

Share this post


Link to post
Share on other sites

I found this old solved bug report with the exact issue I'm having: https://www.autoitscript.com/trac/autoit/ticket/205 The author says the bug is related to anti aliasing rather than directly to Aero. It doesn't go into specifics so I'm having a hard time figuring out how Aero and anti aliasing are related. 

Share this post


Link to post
Share on other sites

boxme,

The Trac report to which you link above does not seek to establish a link between Aero and anti-aliasing - the OP states quite clearly that it is the use of anti-aliasing in games that caused the problem in his case. So if you are trying to use PixelGetColor in a game which uses antialiasing you have your answer (and should read the Forum rules before posting again).

M23

 


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

Share this post


Link to post
Share on other sites

boxme,

The Trac report to which you link above does not seek to establish a link between Aero and anti-aliasing - the OP states quite clearly that it is the use of anti-aliasing in games that caused the problem in his case. So if you are trying to use PixelGetColor in a game which uses antialiasing you have your answer (and should read the Forum rules before posting again).

M23

 

I have read the forum rules and I am not using PixelGetColor in a game. I apologize if I shouldn't have linked to a bug report but he mentions having literally the exact same problem I have and seems to have found a solution so I thought it was relevant. Here's the line where he mentions Aero:

"When one tries to do so in Vista64 (sp1) with aero turned on it always returns 0 when the directX window is active. If one turns off aero then PixelGetColor returns whatever is under that directX window (eg the window below or if nothing is below the desktop background) instead of the directX windows color at that pixel."

The program I am using is not a game and does not have any anti aliasing settings so I am trying to determine if there is a specific Windows anti aliasing setting that is changed when Aero is turned on/off that I should be trying to look at. 

 

Share this post


Link to post
Share on other sites

This link may also be of interest.. if you haven't read it already.  :)

 

 

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