Click here to Skip to main content
15,507,179 members
Articles / Desktop Programming / MFC
Article
Posted 22 May 2000

Stats

114.7K views
16 bookmarked

Changing your monitor's refresh rate

Rate me:
Please Sign up or sign in to vote.
3.00/5 (1 vote)
3 Jun 2000
This article will show you how to change your monitor's refresh rate to a value not available from control panel.

Changing Your Monitor's Refresh Rate

I have an older Sony Trinitron monitor, made approximately in 1992. It's a 20" monitor that supports a resolution of 1024x768. However, whenever I set it to that resolution via Control Panel, the screen image was distored and horribly bowed. I found, on a NT machine, the only way it worked properly was when the refresh rate was set to 70MHz (a resolution of 800x600 required 72MHz, and I wasn't even interested in 640x480). The problem was the machine I wanted to use it on was running Win98, and the only available refresh rates were 65MHz, 75MHz, and 85MHz. A while later I stumbled upon an Win32 function called ChangeDisplaySettings(). The below code snippet shows how to use it to change the refresh rate:

DEVMODE devMode;
::ZeroMemory(&devMode, sizeof(devMode));
devMode.dmDisplayFrequency = 70;
devMode.dmFields = DM_DISPLAYFREQUENCY;
devMode.dmSize = sizeof(devMode);
ChangeDisplaySettings(&devMode, 0);

I created a console application that gets launched at startup which executes the above code. Initially, when Windows starts up, the screen image is distored, but once the program launches I have perfect 1024x768 resolution. So before you get rid of that monitor you just can't seem to adjust, give the above code a try.


License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
Generalabout the code Pin
Virustau14-Apr-06 2:12
Virustau14-Apr-06 2:12 
GeneralPlease, some explanations! Pin
mAXX30-Nov-01 4:04
mAXX30-Nov-01 4:04 
GeneralAn error of great magnitude :-) Pin
Ravi Bhavnani23-May-00 18:53
professionalRavi Bhavnani23-May-00 18:53 
GeneralRe: An error of great magnitude :-) Pin
Dan Pilat24-May-00 11:43
Dan Pilat24-May-00 11:43 
GeneralRe: An error of great magnitude :-) Pin
Watson12-Aug-00 5:32
Watson12-Aug-00 5:32 
GeneralRe: An error of great magnitude :-) Pin
13-Nov-00 17:31
suss13-Nov-00 17:31 
GeneralRe: An error of great magnitude :-) Pin
John T6-Mar-05 5:34
John T6-Mar-05 5:34 
You could have been lucky or not that it works fine
for you. To be most save is this way:

The EnumDisplaySettings function obtains information about one of a display device's graphics modes. You can obtain information for all of a display device's graphics modes by making a series of calls to this function.
Smile | :) ->from MSDN

I surely agree yuo can change the settings under Win 98

BFN and good luck

GeneralCareful here! Pin
George23-May-00 18:25
George23-May-00 18:25 
GeneralRe: Careful here! Pin
20-May-01 5:07
suss20-May-01 5:07 
GeneralRe: Careful here! Pin
20-Jun-01 0:55
suss20-Jun-01 0:55 
GeneralRe: Careful here! Pin
10-Nov-01 5:55
suss10-Nov-01 5:55 
GeneralRe: Careful here! Pin
29-May-02 23:15
suss29-May-02 23:15 
GeneralRe: Careful here! Pin
Anonymous4-Aug-02 4:22
Anonymous4-Aug-02 4:22 
GeneralRe: Careful here! Pin
Anonymous27-Jul-03 9:29
Anonymous27-Jul-03 9:29 
GeneralRe: Careful here! Pin
Raul Sobon20-Apr-04 3:42
Raul Sobon20-Apr-04 3:42 

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.