boxme Posted October 13, 2015 Share Posted October 13, 2015 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? Link to comment Share on other sites More sharing options...
MilesAhead Posted October 13, 2015 Share Posted October 13, 2015 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. My Freeware Page Link to comment Share on other sites More sharing options...
boxme Posted October 14, 2015 Author Share Posted October 14, 2015 (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 October 14, 2015 by boxme Link to comment Share on other sites More sharing options...
boxme Posted October 14, 2015 Author Share Posted October 14, 2015 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. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 14, 2015 Moderators Share Posted October 14, 2015 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 Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Bert Posted October 14, 2015 Share Posted October 14, 2015 You also may want to look at seeing if you can hook into the control directly and not use pixel searching. Pixel searching is inherently not reliable at all due to movement of windows, what window is active and so forth. You may want to look at this: The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
boxme Posted October 14, 2015 Author Share Posted October 14, 2015 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. Link to comment Share on other sites More sharing options...
MilesAhead Posted October 15, 2015 Share Posted October 15, 2015 This link may also be of interest.. if you haven't read it already. My Freeware Page Link to comment Share on other sites More sharing options...
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