Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

changing the desply's resolution


  • Please log in to reply
12 replies to this topic
cstone
  • Members
  • 28 posts
  • Last active: Nov 10 2005 12:53 AM
  • Joined: 16 Apr 2005
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?
cstone

1024x786
  • Guests
  • Last active:
  • Joined: --
Maybe you must close and launch Explorer,
Process, Close, Explorer.Exe
Process, Close, Explorer.Exe
Process, Close, Explorer.Exe
Sleep, 1000
Run, Explorer.Exe
Or, if don't work, close-it from Task Manager.
Bye!

gs
  • Members
  • 25 posts
  • Last active: Jul 15 2007 04:39 AM
  • Joined: 04 Jul 2005
Or call a command-line resolution changer?
Posted Image

mario_a
  • Members
  • 52 posts
  • Last active: Jul 05 2011 06:23 PM
  • Joined: 12 Dec 2004

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

jamestr
  • Members
  • 98 posts
  • Last active: Jul 03 2008 12:30 AM
  • Joined: 05 Apr 2004
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

alan
  • Members
  • 13 posts
  • Last active: Jul 31 2007 02:11 AM
  • Joined: 18 Jan 2006
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%


mario_a
  • Members
  • 52 posts
  • Last active: Jul 05 2011 06:23 PM
  • Joined: 12 Dec 2004
Yes, but I don't think the refresh rate can be changed using EnumDisplaySettings.

alan
  • Members
  • 13 posts
  • Last active: Jul 31 2007 02:11 AM
  • Joined: 18 Jan 2006

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

ender6
  • Members
  • 7 posts
  • Last active: Feb 01 2006 07:57 PM
  • Joined: 15 Jan 2006
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.

ender6
  • Members
  • 7 posts
  • Last active: Feb 01 2006 07:57 PM
  • Joined: 15 Jan 2006
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.

toralf as guest
  • Guests
  • Last active:
  • Joined: --
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.

Laszlo
  • Moderators
  • 4713 posts
  • Last active: Mar 31 2012 03:17 AM
  • Joined: 14 Feb 2005
Here is another pure AHK solution, by manipulating the Windows Display Properties/Settings dialog.

mario_a
  • Members
  • 52 posts
  • Last active: Jul 05 2011 06:23 PM
  • Joined: 12 Dec 2004
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...