1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
| #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; 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) {
;otherwise windows keeps thinking the window is "maximized", even after the resize
WinRestore, A
}
SysGet, workAreaWidth, 0
SysGet, workAreaHeight, 1
workAreaWidth_Third := Round(workAreaWidth/3)
workAreaWidth_Half := Round(workAreaWidth/2)
windowWidth_Third := workAreaWidth_Third+14
windowWidth_Half := workAreaWidth_Half+14
windowHeight := workAreaHeight-34
offset := -7
return
; 33% split
#Numpad4::
GoSub, MoveInit
WinMove,A,,offset,0,windowWidth_Third,windowHeight
return
#Numpad5::
GoSub, MoveInit
WinMove,A,,workAreaWidth_Third+offset,0,windowWidth_Third,windowHeight
return
#Numpad6::
GoSub, MoveInit
WinMove,A,,workAreaWidth_Third*2+offset,0,windowWidth_Third,windowHeight
return
; 50% split
#Numpad1::
GoSub, MoveInit
WinMove,A,,offset,0,windowWidth_Half,windowHeight
return
#Numpad3::
GoSub, MoveInit
WinMove,A,,workAreaWidth_Half+offset,0,windowWidth_Half,windowHeight
return
; 66% split
#Numpad7::
GoSub, MoveInit
WinMove,A,,offset,0,(windowWidth_Third+offset)*2,windowHeight
return
#Numpad9::
GoSub, MoveInit
WinMove,A,,workAreaWidth_Third+offset,0,(windowWidth_Third+offset)*2,windowHeight
return
; Maximize
#Numpad8::
WinMaximize, A
return
; Restore/Minimize
#Numpad2::
WinGet, maximized, MinMax, A
if (maximized){
WinRestore, A
}else{
WinMinimize, A
}
return |