Getting the resolutions the monitor supports (Windows API)

Started by
8 comments, last by Colin Jeanne 18 years ago
Using the windows API. Hello. Does anybody knows how to get the resolutions the monitor can handle? I belive that querying the video modes width EnumDisplaySettings returns the video modes of the video card, but I would like to filter them according to what the monitor can actually display. Thanks in advance.
[size="2"]I like the Walrus best.
Advertisement
ahem. :)

Actually, what I need is the maximun refresh rate the monitor can do.

Thanks.
[size="2"]I like the Walrus best.
well, I'll bump this thread once more and then let it die.
[size="2"]I like the Walrus best.
Is there any reason why the dmDisplayFrequency field in the DEVMODE structure won't give you what you're looking for?
It only returns the frequencies that the video card can do.

For example, it gives me 640x480x32 at 140hz. And my monitor can't do 140hz, not even in 320x200.

From what I've seen, many people hacks a lower and a higher limit for the refresh rate in the source code. But that's kinda nasty. You can hide the modes the monitor doesn't support in the display configuration, so, maybe, there is a way to doit through the API.

If there is one, I guess it's only supported in win2000/xp.

Anyway, if anybody knows about this, please give me a hint. Tnx.
[size="2"]I like the Walrus best.
Perhaps you should be using EnumDisplayModesEx() and set dwFlags to 0? If that doesnt work then maybe you could first get all the display modes and then use ChangeDisplaySettings() with the CDS_TEST flag for each to see if it's valid.

Note - I've never done this before but this method seems to make sense in my head [smile]
I'm going to try that. When you say "valid" what kind of validity are we talking about? I guess the OS should ask the monitor driver about what frequencies it support. I'll see if I can google something on what you hinted me.

tnx!
[size="2"]I like the Walrus best.
I believe you'll get only the video modes both the video card and the monitor can display if you install drivers for the monitor.

Otherwise there is no way for the OS to know what the monitor can display.
_______________The essence of balance is detachment. To embrace a cause, to grow fond or spiteful, is to lose one''s balance after which, no action can be trusted. Our burden is not for the dependent of spirit. - Mayar, Third Keeper
Quote:Original post by izhbq412
... if you install drivers for the monitor.


Good Point! :)

I think I'm running the proper drivers because in the display configuration the modes I get with EnumDisplaySettings are hidden, as not supported. But not really that sure I am...
[size="2"]I like the Walrus best.
Quote:Original post by owl
I'm going to try that. When you say "valid" what kind of validity are we talking about?

By valid, I mean that when you call ChangeDisplaySettings() using CDS_TEST it doesnt tell you that the mode is unsupported.

This topic is closed to new replies.

Advertisement