AutoHotkey Community

It is currently May 27th, 2012, 11:55 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 13 posts ] 
Author Message
PostPosted: November 12th, 2005, 2:15 am 
Offline

Joined: April 16th, 2005, 1:05 am
Posts: 28
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 12th, 2005, 6:17 am 
Maybe you must close and launch Explorer,
Code:
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!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 12th, 2005, 6:53 am 
Offline

Joined: July 4th, 2005, 10:00 am
Posts: 25
Or call a command-line resolution changer?

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 12th, 2005, 1:19 pm 
Offline

Joined: December 12th, 2004, 1:34 pm
Posts: 51
gs wrote:
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.

Code:
NumpadDot & Numpad0::run, C:\Multires.exe /800`,600`,32`,85 /exit


Regards,
Mario


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 5th, 2006, 4:46 pm 
Offline

Joined: April 5th, 2004, 7:24 pm
Posts: 98
Location: Connecticut USA
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject: without multires.exe
PostPosted: January 18th, 2006, 5:58 pm 
Offline

Joined: January 18th, 2006, 5:51 pm
Posts: 13
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

Code:

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%


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 18th, 2006, 6:03 pm 
Offline

Joined: December 12th, 2004, 1:34 pm
Posts: 51
Yes, but I don't think the refresh rate can be changed using EnumDisplaySettings.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 18th, 2006, 6:44 pm 
Offline

Joined: January 18th, 2006, 5:51 pm
Posts: 13
Quote:
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 26th, 2006, 2:50 am 
Offline

Joined: January 16th, 2006, 12:38 am
Posts: 7
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 26th, 2006, 4:34 am 
Offline

Joined: January 16th, 2006, 12:38 am
Posts: 7
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 26th, 2006, 6:51 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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 28th, 2006, 1:44 am 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
Here is another pure AHK solution, by manipulating the Windows Display Properties/Settings dialog.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 28th, 2006, 6:24 am 
Offline

Joined: December 12th, 2004, 1:34 pm
Posts: 51
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...


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], BrandonHotkey and 18 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group