PDA

View Full Version : Changing screen mode


BristolTom
5th April 2005, 10:48 AM
Hiya,

I'm trying to write quite an obscure app for windows that displays bitmaps. The only thing is, I want to be able to set and get the screen resolutions. I also need to be able to fish out the monitor refresh rate, and potentially more stats. I was wondering if anybody might have any C++ code that does this?

Also, what would be the best way to do something like this, DirectX/GDI ?

Tom

VJamm
5th April 2005, 12:42 PM
Are you aware of Platform SDK?

http://msdn.microsoft.com/platformsdk/

Russell

BristolTom
5th April 2005, 02:01 PM
I'm not actually. Had a dig round msdn before I posted, but I found it a bit too easy to get lost in there.

Tom

djMidnight
5th April 2005, 05:20 PM
Look up "ChangeDisplaySettings" in the MSDN, and EnumDisplaySettings. Asking "What's the easiest way to change the display mode in Windows?" is kind of like asking "What's the easiest way to cut off my own arm?". All the options kind of suck. To do it right, you have to verify that the numbers you've chosen are supported by the hardware, which is why you need to use the EnumDisplaySettings function. If this is something for your own use, you're probably fine without it.

If you're brave, DirectX is a good way to do it, but has its own problems. If you're using DirectX 8 or better, you'll need to use 3D calls to draw your 2D bitmap. The alternative is to get the DirectDraw 7 interface and use the 2D blitter calls through that.

Jason

stex
30th June 2005, 08:19 PM
hi!

google around for these API calls/constants

GetDeviceCaps
HORZRES
VERTRES
BITSPIXEL
VREFRESH