Sign in to follow this  
owl

Getting the resolutions the monitor supports (Windows API)

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this