I made an app that returns the RGB values of the pixel the mouse is over, but it only does this when the mouse is in the window itself, it wont do it on like the desktop. Why?
Printable View
I made an app that returns the RGB values of the pixel the mouse is over, but it only does this when the mouse is in the window itself, it wont do it on like the desktop. Why?
First you must use WindowFromPoint API to get the hWnd the window is over. Then from there, use GetWindowDC t get the DC and then use GetPixel to get the colour.
OR directly use GetDesktopWindow and get the ´DC with GetDC
Ok i got it working now, but for some reason the edit boxes that show the values to the user blink alot, and the box contaning blue value doesnt even update itself, but the others do. Any ideas?
Now im really frustrated, i found a way around that problem, but now for some reason it wont update itself when its outside of the dialog. I have a start button. You press it and it turns to a stop button and it starts showing the values. If you move the cursor off the dialog, it stops. But while off the dialog, if you press the spacebar and trigger the stop button, it will show the values of the color of the pixel the mouse is resting over (outside the dialog). Again, any ideas?