Skip to content

Instantly share code, notes, and snippets.

@veziak
Last active September 24, 2018 22:34
Show Gist options
  • Save veziak/7c35e0a4b3d235c46e1af2c9845849f8 to your computer and use it in GitHub Desktop.
Save veziak/7c35e0a4b3d235c46e1af2c9845849f8 to your computer and use it in GitHub Desktop.
; Skips the gentle method of activating a window and goes straight to the forceful method.
#WinActivateForce
; Don't display a tray icon
; #NoTrayIcon
; Things to do before moving a window
MoveInit:
WinGet, maximized, MinMax, A
if (maximized)
WinRestore, A
SysGet, Scr, MonitorWorkArea
return
; Restore or minimize a window
RestoreOrMinimize:
WinGet, maximized, MinMax, A
if (maximized)
WinRestore, A
else
WinMinimize, A
return
; Arrow keys
#down::
GoSub, MoveInit
WinMove,A,,0.0,ScrBottom/2.0,ScrRight,ScrBottom/2.0
return
#up::
GoSub, MoveInit
WinMove,A,,0.0,0.0,ScrRight,ScrBottom/2.0
return
#left::
GoSub, MoveInit
WinMove,A,,ScrLeft,ScrTop,ScrRight/2.0,ScrBottom
return
#right::
GoSub, MoveInit
WinMove,A,,ScrRight/2.0,ScrTop,ScrRight/2.0,ScrBottom
return
#1::
GoSub, MoveInit
WinMove,A,,0.0,0.0,ScrRight,ScrBottom/3.0
return
#2::
GoSub, MoveInit
WinMove,A,,0.0,ScrBottom/3.0,ScrRight,ScrBottom/3.0
return
#3::
GoSub, MoveInit
WinMove,A,,0.0,ScrBottom/3.0*2.0,ScrRight,ScrBottom/3.0
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment