My focus is on making software, coaching Agile/Scrum teams, and being a husband and father--definitely not on blogging--so please do not expect very frequent posts here.

Monday, May 13, 2019

Easy screen resolution changes

I’m using the following AutoHotKey shortcuts to quickly change my screen resolution on my 27” 4K display from 4K (normal work) to 1080p (or “2K”, for screen sharing over Skype, MS Teams, or Slack).  I simply press Win+Alt+2 for 2K and Win+Alt+4 for 4K. Enjoy!

#!4::
ChangeResolution(3840, 2160)
Return

#!2::
ChangeResolution(1920, 1080)
Return

ChangeResolution(Screen_Width := 1920, Screen_Height := 1080, Color_Depth := 32)
{
     VarSetCapacity(Device_Mode,156,0)
     NumPut(156,Device_Mode,36)
     DllCall( "EnumDisplaySettingsA", UInt,0, UInt,-1, UInt,&Device_Mode )
     NumPut(0x5c0000,Device_Mode,40)
     NumPut(Color_Depth,Device_Mode,104)
     NumPut(Screen_Width,Device_Mode,108)
     NumPut(Screen_Height,Device_Mode,112)
     Return DllCall( "ChangeDisplaySettingsA", UInt,&Device_Mode, UInt,0 )
}
Return

No comments:

Post a Comment