Use SetCapture() to direct all mouse input to your window. When the user clicks, take note of the xPos, yPos coordinates. Transform them to the desktop space using ClientToScreen(). Once you have done that, you'll need to access the root window's DC. Here's a MSDN article on how to do just that: http://msdn.microsoft.com/en-us/library/ms532314.aspx
Once you have a bitmap, you can either decode the pixel data directly, or convert the bitmap to the pixel format of your choice and decode the pixel data then.
You might want to google about and see who else has done what you want. It is possible someone has already written all the code to do this.