i have found the register key that has the resolution information in it, and i am able to change it. the problem is that even if i do an EnvUpdate, it doesn't really change the resolution. the reg says it is what it to be (800x600), but it still is at what it use to be (1024x786).
does anyone know how to get the change to be updated so the resolution will change?
changing the desply's resolution
Started by
cstone
, Nov 12 2005 01:15 AM
12 replies to this topic
Maybe you must close and launch Explorer,
Bye!
Process, Close, Explorer.Exe Process, Close, Explorer.Exe Process, Close, Explorer.Exe Sleep, 1000 Run, Explorer.ExeOr, if don't work, close-it from Task Manager.
Bye!
#2
-
Posted 12 November 2005 - 05:17 AM
Or call a command-line resolution changer?
Absolutely. This is the simplest way.
I use MultiRes for this.
If you're interested, here's how my AHK code to call MultiRes from the command-line to change the resolution to 800 x 600 looks like.
NumpadDot & Numpad0::run, C:\Multires.exe /800`,600`,32`,85 /exit
Regards,
Mario
#4
-
Posted 12 November 2005 - 12:19 PM
sweet multires!
Numpad0 & Numpad2::run, E:\Program Files\MultiRes\MultiRes.exe /800`,600`,32`,72 /exit
Numpad0 & Numpad1::run, E:\Program Files\MultiRes\MultiRes.exe /640`,480`,32`,72 /exit
Numpad0 & Numpad3::run, E:\Program Files\MultiRes\MultiRes.exe /1024`,768`,32`,72 /exit
Numpad0 & Numpad2::run, E:\Program Files\MultiRes\MultiRes.exe /800`,600`,32`,72 /exit
Numpad0 & Numpad1::run, E:\Program Files\MultiRes\MultiRes.exe /640`,480`,32`,72 /exit
Numpad0 & Numpad3::run, E:\Program Files\MultiRes\MultiRes.exe /1024`,768`,32`,72 /exit
#5
-
Posted 05 January 2006 - 03:46 PM
Just wanted to share how I do this on XP SP2 with an LCD monitor (no refresh rate issues). This changes the display to 1024x768. Perhaps this would help someone not wishing to install multires
ENUM_CURRENT_SETTINGS := -1 HEIGHT := 1024 WIDTH := 768 SysGet, MonitorName, MonitorName, %A_Index% displayname := MonitorName VarSetCapacity(display, 10000) ret := DllCall("EnumDisplaySettings", "Str", displayname, "UInt", ENUM_CURRENT_SETTINGS, Str, display) if ErrorLevel MsgBox Error level %ErrorLevel% InsertInteger(HEIGHT, display, 108) ; InsertInteger() from the help files InsertInteger(WIDTH, display, 112) ; InsertInteger() from the help files ret := DllCall("ChangeDisplaySettings", "Str", display, "UInt", 0) if ErrorLevel MsgBox Error level %ErrorLevel%
#6
-
Posted 18 January 2006 - 04:58 PM
Yes, but I don't think the refresh rate can be changed using EnumDisplaySettings.
#7
-
Posted 18 January 2006 - 05:03 PM
Yes, but I don't think the refresh rate can be changed using EnumDisplaySettings.
I don't know, but there is a member within the DEVMODE struct seems to reference refresh/freq - dmDisplayFrequency so it may be possible.
I don't know the offset for it (though it shouldn't be hard to find) and don't use a CRT so I can't test it.
-Alan
#8
-
Posted 18 January 2006 - 05:44 PM
Alan,
That's a sweet script. It was just what I was looking for. Although, since this is way over my ability to understand how it works, how could I restore my resolution to the previous setting?
Basically, I'd like to run switch into 800x600 mode, run some program and then switch back to the original mode. Furthermore, if my screen is already 800 x 600, I'd like the script to exit the function.
I figure I've got to get something to read the current settings and save it to a var like OldHEIGHT, OLDWIDTH and just run the function again. But I guess I'm not understanding the DLLCall, all those parameters and the ret := and how to store/retrieve the right info.
Thanks in advance.
That's a sweet script. It was just what I was looking for. Although, since this is way over my ability to understand how it works, how could I restore my resolution to the previous setting?
Basically, I'd like to run switch into 800x600 mode, run some program and then switch back to the original mode. Furthermore, if my screen is already 800 x 600, I'd like the script to exit the function.
I figure I've got to get something to read the current settings and save it to a var like OldHEIGHT, OLDWIDTH and just run the function again. But I guess I'm not understanding the DLLCall, all those parameters and the ret := and how to store/retrieve the right info.
Thanks in advance.
#9
-
Posted 26 January 2006 - 01:50 AM
Hmmm... here's another thing that I don't understand:
So I take Alan's code and wrap it in my function
SetScreen800x600(){ above code lines here
}
Then in my script hotkey script, I've got
+^!F11::
ifWinExist, MyApp
SetMonitor800x600()
WinActivate, MyApp
SetKeyDelay, 0, 10
Send, +^!F11
SetKeyDelay, 0, 0
Return
The monitor gets switched but then nothing else happens. It looks like after the SetMonitor function runs, the WinActivate gets lost during the monitor switch.
So I take Alan's code and wrap it in my function
SetScreen800x600(){ above code lines here
}
Then in my script hotkey script, I've got
+^!F11::
ifWinExist, MyApp
SetMonitor800x600()
WinActivate, MyApp
SetKeyDelay, 0, 10
Send, +^!F11
SetKeyDelay, 0, 0
Return
The monitor gets switched but then nothing else happens. It looks like after the SetMonitor function runs, the WinActivate gets lost during the monitor switch.
#10
-
Posted 26 January 2006 - 03:34 AM
Since you said that the switching of the Res is working, I think you are a bit off topic here. You should have posted it in your own topic (I just answered).
It may help to add a Sleep after the SetMonitor() and maybe to increase the values of setkeydelay to high values, e.g. 100. If that works, then you can start to decrease them.
It may help to add a Sleep after the SetMonitor() and maybe to increase the values of setkeydelay to high values, e.g. 100. If that works, then you can start to decrease them.
#11
-
Posted 26 January 2006 - 05:51 AM
This method does have the advantage of not needing a 3rd party utility, but in my experience command-line tools almost always work better, and are more reliable than sending keystrokes etc...
#13
-
Posted 28 February 2006 - 05:24 AM