Aug 152013
 
 August 15, 2013  Posted by at 6:46 am Random, Uncategorized  Add comments

When recording videos I need to record at one resolution, and when I edit I do so at a different resolution. I’ve been using a very simple autohotkey script for this that I thought might be worth sharing πŸ™‚ Ctrl 8 and Ctrl 9 lets you toggle between two set screen resolutions – you can of course change the script however you want.

screen

If you are new to Autohotkey read: Stupid Question 188-193: What is AutoHotKey, macros, automation software, hotkeys and scripts?

  1. Download autohotkey
  2. Create new text file with script below and save with .ahk extension
  3. Right click on file and run the script

[sourcecode language=”javascript”]
;
; AutoHotkey Version: 1.x
; Language: English
; Platform: Win9x/NT

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

^8::
ChangeResolution(1920,1080)
return

^9::
ChangeResolution(1024,768)
return

ChangeResolution(w,h) {
VarSetCapacity(dM,156,0)
NumPut(156,dM,36)
NumPut(0x5c0000,dM,40)
NumPut(w,dM,108)
NumPut(h,dM,112)
DllCall( "ChangeDisplaySettingsA", UInt,&dM, UInt,0 )
}
[/sourcecode]

  8 Responses to “Autohotkey script for toggling between resolutions / changing screen resolution in Windows”

  1. #1, You’ve solved a problem that’s been really pissing me off with my yoga2pro. It’s got a 3000×1920 display that makes illustrator look like it’s a million miles away. But on the resolution setting below that, everything else is HUGE.
    #2 You’re stunning πŸ™‚

  2. 3200×1800* but seriously this is the best script ever. I feel like a 5 year old, it’s so easy and fun switching back and forth.

  3. Thanks, that works and I use it to toggle my HTPC (win 7 x64) between HDTV resolution and a sensible VNC desktop size.

  4. this was great, thanks

  5. This is an awesome script, so concise! Never again will I have to put up with stupid video game image cropping on my portrait monitor.

  6. Hello, I just stumbled on your page after days of trying to figure out an efficient way of setting screen resolutions using ahk, what a great little script you have there πŸ™‚ .

    I do have questions if I may. I need to change the scaling so that when selecting 1024×768 it doesn’t stretch to 16×9 or when I select 1366×768 it doesn’t center rather than scaling to fullscreen. My guess is specifying the scaling will help if possible. I also need to do the same to the external monitor and choose if it’s outputing in miror mode or extended desktop.

    Is it possible using your method? Do you have any idea how?

    Thanks btw, you are so bookmarked πŸ˜€

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

What is 14 + 12 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)