Click here to Skip to main content
6,594,432 members and growing! (14,860 online)
Email Password   helpLost your password?
Platforms, Frameworks & Libraries » Win32/64 SDK & OS » General     Intermediate

Changing your monitor's refresh rate

By Dan Pilat

This article will show you how to change your monitor's refresh rate to a value not available from control panel.
VC6Win2K, Visual Studio, MFC, Dev
Posted:22 May 2000
Updated:3 Jun 2000
Views:77,818
Bookmarked:14 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
20 votes for this article.
Popularity: 5.20 Rating: 4.00 out of 5

1

2
1 vote, 100.0%
3

4

5

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

About the Author

Dan Pilat


Member

Location: United States United States

Other popular Win32/64 SDK & OS articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 15 of 15 (Total in Forum: 15) (Refresh)FirstPrevNext
Generalabout the code PinmemberVirustau2:12 14 Apr '06  
GeneralPlease, some explanations! PinmembermAXX4:04 30 Nov '01  
GeneralAn error of great magnitude :-) PinsussRavi Bhavnani18:53 23 May '00  
GeneralRe: An error of great magnitude :-) PinsussDan Pilat11:43 24 May '00  
GeneralRe: An error of great magnitude :-) PinsussWatson5:32 12 Aug '00  
GeneralRe: An error of great magnitude :-) PinmemberAnonymous17:31 13 Nov '00  
GeneralRe: An error of great magnitude :-) PinmemberJohn T5:34 6 Mar '05  
GeneralCareful here! PinsussGeorge18:25 23 May '00  
GeneralRe: Careful here! PinmemberShimon5:07 20 May '01  
GeneralRe: Careful here! PinmemberAnonymous0:55 20 Jun '01  
GeneralRe: Careful here! PinmemberAnonymous5:55 10 Nov '01  
GeneralRe: Careful here! PinmemberMe_23:15 29 May '02  
GeneralRe: Careful here! PinsussAnonymous4:22 4 Aug '02  
GeneralRe: Careful here! PinsussAnonymous9:29 27 Jul '03  
GeneralRe: Careful here! PinmemberRaul Sobon3:42 20 Apr '04  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 3 Jun 2000
Editor: Chris Maunder
Copyright 2000 by Dan Pilat
Everything else Copyright © CodeProject, 1999-2009
Web18 | Advertise on the Code Project