tags:

views:

31

answers:

1

Is there a windows API to get the number of colors currently set on the display settings? What I mean is, if you look at the windows display setting you might get something like:

resolution: 1280x800 colors: 1,000,000

I am using a call to WMI (Win32_VideoController) and get them from there, but I can't use this since the program cannot use WMI.

Is there an API or other way (the registry maybe?) to get the number of colors the system supports?

code is appreciated, thanks!

+2  A: 

GetDeviceCaps with the BITSPIXEL option is what you're looking for

Paul Betts
great. Now, this will return the information for the main display card, right?what will happen if there is more than one?
Jessica
Then you'll need to pass a different device name to CreateDC(). Use MonitorFromPoint and GetMonitorInfo to get the device name.
Hans Passant
I'm passing as follow: hdc = CreateDCA("DISPLAY", NULL, NULL, NULL);
Jessica
got it. thanks so much for the help
Jessica