Click here to Skip to main content
15,913,854 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralABOUT COFF AND OMF Pin
gdzfy20-Jul-03 17:43
gdzfy20-Jul-03 17:43 
QuestionHow do you get the number of colors displayed? Pin
Terry O'Nolley20-Jul-03 15:04
Terry O'Nolley20-Jul-03 15:04 
AnswerRe: How do you get the number of colors displayed? Pin
Ryan Binns20-Jul-03 15:44
Ryan Binns20-Jul-03 15:44 
GeneralRe: How do you get the number of colors displayed? Pin
Atlantys20-Jul-03 15:47
Atlantys20-Jul-03 15:47 
GeneralRe: How do you get the number of colors displayed? Pin
J. Dunlap20-Jul-03 15:49
J. Dunlap20-Jul-03 15:49 
GeneralRe: How do you get the number of colors displayed? Pin
Ryan Binns20-Jul-03 15:51
Ryan Binns20-Jul-03 15:51 
GeneralRe: How do you get the number of colors displayed? Pin
Terry O'Nolley20-Jul-03 16:07
Terry O'Nolley20-Jul-03 16:07 
GeneralRe: How do you get the number of colors displayed? Pin
Ryan Binns20-Jul-03 16:30
Ryan Binns20-Jul-03 16:30 
It will always work for the primary display. If you are using multiple displays, you'll need to use EnumDisplaySettings() as pointed out in another answer. Use ENUM_CURRENT_SETTINGS to return the current settings. The dmBitsPixel member of the DEVMODE structure will give the number of bits per pixel:
DEVMODE dm;
dm.dmSize = sizeof(DEVMODE);
EnumDisplaySettings(lpszDeviceName, ENUM_CURRENT_SETTINGS, &dm);
lpzsDeviceName is the name of the device (returned by EnumDisplayDevices()), or NULL to use the primary device.

Hope this helps,

Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

GeneralRe: How do you get the number of colors displayed? Pin
Atlantys20-Jul-03 16:54
Atlantys20-Jul-03 16:54 
GeneralRe: How do you get the number of colors displayed? Pin
Ryan Binns20-Jul-03 17:55
Ryan Binns20-Jul-03 17:55 
GeneralRe: How do you get the number of colors displayed? Pin
Atlantys20-Jul-03 19:19
Atlantys20-Jul-03 19:19 
GeneralRe: How do you get the number of colors displayed? Pin
Ryan Binns20-Jul-03 19:28
Ryan Binns20-Jul-03 19:28 
GeneralRe: How do you get the number of colors displayed? Pin
Atlantys20-Jul-03 19:52
Atlantys20-Jul-03 19:52 
GeneralRe: How do you get the number of colors displayed? Pin
Terry O'Nolley21-Jul-03 1:39
Terry O'Nolley21-Jul-03 1:39 
GeneralRe: How do you get the number of colors displayed? Pin
Ryan Binns21-Jul-03 1:45
Ryan Binns21-Jul-03 1:45 
AnswerRe: How do you get the number of colors displayed? Pin
Atlantys20-Jul-03 15:47
Atlantys20-Jul-03 15:47 
GeneralMSDN 2003 Pin
Toni7820-Jul-03 13:32
Toni7820-Jul-03 13:32 
GeneralRe: MSDN 2003 Pin
Atlantys20-Jul-03 14:50
Atlantys20-Jul-03 14:50 
GeneralRe: MSDN 2003 Pin
Toni7820-Jul-03 15:27
Toni7820-Jul-03 15:27 
GeneralRe: MSDN 2003 Pin
Atlantys20-Jul-03 15:41
Atlantys20-Jul-03 15:41 
GeneralRe: MSDN 2003 Pin
Ryan Binns20-Jul-03 15:48
Ryan Binns20-Jul-03 15:48 
GeneralRe: MSDN 2003 Pin
Toni7820-Jul-03 16:04
Toni7820-Jul-03 16:04 
GeneralRe: MSDN 2003 Pin
Ryan Binns20-Jul-03 16:31
Ryan Binns20-Jul-03 16:31 
GeneralRe: MSDN 2003 Pin
Atlantys20-Jul-03 16:57
Atlantys20-Jul-03 16:57 
GeneralRe: MSDN 2003 Pin
J. Dunlap20-Jul-03 20:08
J. Dunlap20-Jul-03 20:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.