Changing Refresh Rate With ChangeDisplaySettings()

This is a discussion on Changing Refresh Rate With ChangeDisplaySettings() within the Windows Programming forums, part of the Platform Specific Boards category; 1. I'm using the following code to change my display settings: Code: DEVMODE devModeScreen; memset(&devModeScreen, 0, sizeof(devModeScreen)); devModeScreen.dmSize = sizeof(devModeScreen); ...

  1. #1
    Registered User
    Join Date
    Aug 2005
    Posts
    16

    Question Changing Refresh Rate With ChangeDisplaySettings()

    1. I'm using the following code to change my display settings:
    Code:
    DEVMODE devModeScreen;
    
    memset(&devModeScreen, 0, sizeof(devModeScreen));
    devModeScreen.dmSize = sizeof(devModeScreen);	
    devModeScreen.dmPelsWidth = width;			
    devModeScreen.dmPelsHeight = height;			
    devModeScreen.dmBitsPerPel = bits;			
    devModeScreen.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL;
    devModeScreen.dmDisplayFrequency = 85;
    
    ChangeDisplaySettings(&devModeScreen, CDS_FULLSCREEN)
    However, the refreash rate changes to 60Hz. My monitor is capable of 85Hz at the specified resolution. Why isn't the refresh rate displaying at 85Hz?

    2: Can I use something like GetSystemMetrics() to know the current display's refresh rate?

  2. #2
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    1) I have absolutely no idea! Sorry about that
    2) ::GetDeviceCaps(::GetDC(NULL), VREFRESH)

  3. #3
    Registered User
    Join Date
    Aug 2005
    Posts
    16
    Quote Originally Posted by Tonto
    1) I have absolutely no idea! Sorry about that
    2) ::GetDeviceCaps(::GetDC(NULL), VREFRESH)
    This returned a value of 0.

    Also, my window is not displaying in full screen mode. The taskbar, window borders, and title bar are still visible. Any insight on this?

  4. #4

  5. #5
    Registered User
    Join Date
    Aug 2005
    Posts
    16
    Quote Originally Posted by Codeplug
    Thanks for that. The search appears to be down so I probably wouldn't have found that.

    It seems I was missing a great deal of data from my DEVMODE structure that was filled in by EnumDisplaySettings().

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Monitor Refresh Rates
    By SlyMaelstrom in forum Tech Board
    Replies: 4
    Last Post: 05-24-2006, 02:08 PM
  2. curses problem
    By rajesh23 in forum Linux Programming
    Replies: 2
    Last Post: 10-07-2003, 08:27 AM
  3. Monitor Refresh Rate
    By golfinguy4 in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 02-10-2003, 05:51 AM
  4. finding monitor refresh rate
    By eats only heads in forum Windows Programming
    Replies: 2
    Last Post: 12-14-2002, 04:12 PM
  5. XP Refresh Rate
    By (TNT) in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 10-24-2001, 10:37 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21