Change refresh rate ONLY

Get help with using AutoHotkey and its commands and hotkeys
Posts: 3
Joined: 10 Mar 2016, 11:02

Change refresh rate ONLY

20 Oct 2019, 13:47

Hi, I was wondering if it's possible to change refresh rate without doing anything with the resolution. In other words, is it possible to get to this windows function: Display Settings -> Advanced Display Settings -> Display adapter properties for Display x -> Monitor and then change Screen refresh rate programmatically (without opening any of the windows obviously)?

I am already using this code now (which I found by searching) to change my refresh rate to 60 Hz on a bezel corrected surround setup:

Code: Select all

ChangeResolution( cD, sW, sH, rR ) {
  VarSetCapacity(dM,156,0), NumPut(156,2,&dM,36)
  DllCall( "EnumDisplaySettingsA", UInt,0, UInt,-1, UInt,&dM ), 
  NumPut(cD,dM,104), NumPut(sW,dM,108), NumPut(sH,dM,112), NumPut(rR,dM,120)
  Return DllCall( "ChangeDisplaySettingsA", UInt,&dM, UInt,0 )
But I was wondering if it's possible to JUST change the refresh rate without involving any of the pixel and color depth parameters.

Any help will be greatly appreciated :)
Posts: 3
Joined: 10 Mar 2016, 11:02

Re: Change refresh rate ONLY

23 Oct 2019, 05:02

I found this amazing program that made everything really easy:

Insert :// after http to make the link work.
just me
Posts: 6547
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Change refresh rate ONLY

23 Oct 2019, 11:01

Might do it:

Code: Select all

ChangeDisplayFrequency(Frequency) {
   VarSetCapacity(DEVMODE, 156, 0)
   NumPut(156, DEVMODE, 36, "UShort")
   DllCall("EnumDisplaySettingsA", "Ptr", 0, "UInt", -1, "Ptr", &DEVMODE)
   NumPut(0x400000, DEVMODE, 40)
   NumPut(Frequency, DEVMODE, 120, "UInt")
   Return DllCall("ChangeDisplaySettingsA", "Ptr", &DEVMODE, "UInt", 0)

Return to “Ask For Help”

Who is online

Users browsing this forum: ben95, Bing [Bot], grumegargler, joefiesta, MannyKSoSo, micchanahk, MikeyG12, toddhere, zvit and 116 guests