setting srceen size for specific gui

Get help with using AutoHotkey and its commands and hotkeys
MonuKashyap
Posts: 48
Joined: 06 Jun 2016, 21:32

setting srceen size for specific gui

15 Sep 2018, 05:09

how to set screen size 1366x768 for gui window named mywindow only, and when mywindow is not active (minimized or closed), then screen will set default setting/resolution.
any idea?
garry
Posts: 1814
Joined: 22 Dec 2013, 12:50

Re: setting srceen size for specific gui

15 Sep 2018, 05:20

just a short example to set screenresolution with hotkey , like ctrl+alt+F9 = FullHD

Code: Select all

setworkingdir,%a_scriptdir%

^!F8::
ChangeResolution(1280, 720)
Return

^!F9::
ChangeResolution(1920, 1080)
Return

^!F10::
ChangeResolution(2048, 1536)
Return

^!F11::
ChangeResolution(2560, 1440)   ;- WQHD
Return

^!F12::
ChangeResolution(3840, 2160)   ;- 4K UHD
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


Return to “Ask For Help”

Who is online

Users browsing this forum: 1100++, aircooled, Google [Bot], sinkfaze and 203 guests