colour issue.

adibas
01-17-2005, 02:19 PM
I want to build a program which will show the colour of the background
behind the mouse whenever the user presses the mouse.
I want to show the colour in this format: #FFDDAA.

I don't want the user to use the "Print Screen" button at all.
When the mouse is clicked, regardless of where it is- it can be in the
IE or taskbar or the mouse can be over the wallpaper, The program
will show me the colour of whatever the mouse is over.


Thanks in advance! :D

Toveling
01-17-2005, 02:28 PM
I'd imagine you could use a combination of GetDesktopWindow, GetDC, BitBlt, and GetCursorPos. Just Blt the pixel where the mouse is from the screen's DC to a picturebox or StdPicture object, then figure out what the color is via GetPixel.

There's probably a much easier way, but all I can think of right now.

Edit:
Doing the mouse click thing might be possible via SetCapture, and there are many ways to format color into web values, search the forum.

adibas
01-18-2005, 05:26 AM
Can someone please write me the code because I can't seen to
understand all these functions? :confused:

thanks.

lebb
01-18-2005, 08:03 AM
No, sorry, this isn't a code handout site. If you need code written to order, you might try www.rentacoder.com. Or if you'd like advice here, please give it a try and post the code you're using and where you're having trouble, and we can help.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum