Icy North Logo
ARTICLE

Home
The place to start.

Development
Software development links, free utilities, source code, product reviews and more.

Products
Product information, downloads and purchasing information.

Contact/About
Who's behind this site and how to contact them.

What's New
All of the latest news and articles.

Community
An open forum to discuss Icy North products or site content.



Resolution Changer DLL

Brett Kapilik
Saturday, April 05, 2003

ResMaster.dll is a DLL that can be used to query and change a system's display modes. I wrote this DLL for use with AutoPlay Media Studio 4.0, although it should be callable from any Win32 program written in C, C++, Delphi, VB, etc.  You might want to use this DLL to change a user's display settings when your application starts and then to set it back again when the application exits.

WARNING: CHANGING A USER'S SCREEN RESOLUTION DYNAMICALLY IS NOT A STANDARD THING TO DO.  IT CAN CAUSE PROBLEMS WITH AND POTENTIALLY DAMAGE A SYSTEM'S HARDWARE.  YOU MUST USE THIS DLL AT YOUR OWN RISK.  ICY NORTH TECHNOLOGIES AND BRETT KAPILIK ASSUME NO RESPONSIBILITY FOR DAMAGED CAUSED BY USING THIS DLL IN YOUR APPLICATIONS. IF YOU DO NOT UNDERSTAND OR AGREE TO THESE TERMS, PLEASE DO NOT DOWNLOAD OR USE THIS DLL.

ResMaster.dll was written in C++ and does not have any external dependencies. It exposes three functions:

LPCTSTR GetCurrentDisplayMode()
Returns the display's current settings in the format WIDTH,HEIGHT,BITSPERPIXEL,FREQUENCY.  For example 1024,768,32,75 means 1024x768 at 32 bits per pixel with a 75 Hertz.   It is a good idea to retrieve and store this informaiton at the start of your application so that you can restore it later or when your application exits.

LPCTSTR GetAllDisplayModes()
Returns all display modes supported by the primary display in a semi-colon delimited string.  For example:

320,200,8,60;320,200,8,75;320,200,16,60;etc...

int SetDisplayMode(int nWidth, int nHeight, int nBPP, int nFreq)
Changes the display mode with the specfied values. Returns 1 if successful, 0 if it fails. Internally the function checks first to make sure that the mode is supported.  However, you should still do some checks of your own.  It is a good idea to prompt the user to make sure that they want to change their display resolution, even temporarily.

Download ResMasterTest.zip
This download contains the DLL and an AutoPlay Media Studio 4.0 project file that demonstrates usage. You are free to use this DLL in any way that you wish without restrictions. However, you must use it at your own risk. It does not come with any warranties or guarantees whatsoever.

Download ResMaster_Source.zip
This download contains the Visual C++ 6.0 source code used to create this DLL.  Feel free to modify, change and learn at will.


 

Home - Development - Products - Contact/About - What's New - Community

Copyright © 2002 Icy North Technologies
info@icynorth.com