#Tools – AutoHotKey + Display Changer II to quickly change screen resolutions with a hot key

Buy Me A Coffee

Hi !

A couple of weeks ago, wrote a post where I explained how we can use Display Changer II to quickly change between monitor / screens configurations. Quoting myself:

I mainly share my landscape monitor, however my default resolution in this monitor is 2560×1080. So, every time I share my screen, I found myself in Windows 10 Display Settings, to change the monitor resolution to 1920 x 1080.

My self sometime ago.
Bruno Office

I have 2 BAT files to change between ShareScreen mode and WorkMode. And, chatting with Frank Boucher (@fboucheros), he mentioned an amazing app for Windows: AutoHotKey (see references).

You can do several tasks with AutoHotKey, however the hotkey / keybindings part is important:

Define hotkeys for the mouse and keyboard, remap keys or buttons and autocorrect-like replacements. Creating simple hotkeys has never been easier; you can do it in just a few lines or less!

AutoHotKey Key Bindings

I created a AutoHotKey file with the following content:

+!s::
run, %comspec% /c "d:\Program Files\dc2\ShareScreenMode.bat",,hide
return

+!w::
run, %comspec% /c "d:\Program Files\dc2\WorkMode.bat",,hide
return

This file, will hook up to the following keys combination

  • Shift + Alt + S, change resolutions for Share Screen
  • Shift + Alt + W, change resolutions for Default Work Screen

I may mention that I’m using the command

run, %comspec% /c "d:\Program Files\dc2\WorkMode.bat",,hide

to run the command without displaying any window. Another option is to run the following command, where you will see the command prompt for a couple of seconds.

RunWait "d:\Program Files\dc2\ShareScreenMode.bat"

And, my next step will be to hide the clock in the system tray when I’m in share screen mode. This is work in progress

; Simulate Press Windows Key
Send, {Ctrl down}{Escape down}
; type on the search
Send, turn system icons on or off
; hit return
Send, {Return}
; activate and wait for Settings windows
WinActivate, Settings 
WinWaitActive, Settings
; crappy sleep code
Sleep, 2000
; enable / disable the 1st item, time
SendInput, {Space}
; crappy sleep code 
Sleep, 2000

Happy coding!

Greetings

El Bruno

Resources

#Tools – Display Changer II, change your monitor configuration with 1 click

Buy Me A Coffee

Hi !

These remote working days, I’ve found myself sharing my screen several times a day. My desktop setup is standard with an UltraWide Landscape monitor and a “Normal” Portrait monitor.

home desktop with my 2 monitors

I mainly share my landscape monitor, however my default resolution in this monitor is 2560×1080. So, every time I share my screen, I found myself in Windows 10 Display Settings, to change the monitor resolution to 1920 x 1080.

windows 10 display settings

And, as you can imagine, this is not a super happy task.

During the last couple of days, I read a lot about people using StreamDeck (see references), to automate actions. Mostly for video productions, and to share videos in Twitch, YouTube, Mixer, etc. And this posts, I found an amazing tool:

Display Changer II

And the author really explains how and why this is a necessary tool:

Display Changer II changes your Windows display resolution, runs a program, then restores the original settings. This is useful for games and home-theater computers. I wrote Display Changer II because many programs run best under a particular resolution (e.g., 640×480 with 8-bit color depth or 1920×1080 with a 24 Hz refresh rate). I grew tired of manually changing the Windows display settings manually, so I wrote Display Changer II to do it automatically.
Display Changer II changes your Windows desktop width, height, color depth, refresh rate, and rotation temporarily or permanently (via a configuration file). Display Changer II can run another application in a specific display resolution and return to the previous resolution when the application finishes. It can change the resolution permanently and rearrange the monitors in a multiple-monitor setup. Display Changer II can also duplicate (clone) your monitors, extend the desktop to multiple monitors, configure only the primary PC screen, and configure only the secondary screen.
Display Changer II uses configuration files to specify display settings. It can create configuration files from existing settings, which eliminates the need for you to edit the files yourself. The configuration file specifies every setting for each monitor, including the very precise refresh rates needed for home-theater systems.

Following the instructions, I’ve created 2 configurations files: ShareScreenMode.xml and Default.xml. The command to create these files is

.\dc2.exe -create="ShareScreenMode.xml"

And I also created 2 bat files to run DCV2 with each specific the configuration. the bat content is:

.\dc2.exe -configure="ShareScreenMode.xml"

Ant, that’s it! I got my 2 files to quickly change my screen resolution with an amazing and free tool.

Important: The author have a commercial license for the tool, and also support donations. I’ll give it a try for a couple of weeks, and if it works, I’ll be happy to share some CAD with the author. I hope you can do the same.

Happy coding!

Greetings

El Bruno

Resources