-
Notifications
You must be signed in to change notification settings - Fork 0
/
WinMove.ahk
71 lines (64 loc) · 1.84 KB
/
WinMove.ahk
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
#Requires AutoHotkey v2.0
#SingleInstance Force
A_IconTip := "WinMove 2024.11"
; Alt + w
!w:: {
process_name := WinGetProcessName("A")
title := WinGetTitle("A")
switch (process_name) {
case "KakaoTalk.exe":
switch (title) {
case "카카오톡":
WinMove(764, 199, 392, 642, "A")
case "":
WinMove(1160, 199, 510, 640, "A")
default:
WinMove(1164, 199, 380, 640, "A")
}
case "Screenpresso.exe":
WinMove(1255, 562, 660, 473, "A")
case "fraps.exe":
WinMove(657, 335, 606, 369, "A")
default:
vertical_scale := A_ScreenHeight / 1080
horizontal_scale := A_ScreenWidth / 1920
if (process_name ~= "i)cmd.exe|mintty.exe|notepad.exe|powershell.exe|Taskmgr.exe") {
WinMove(
horizontal_scale * 480,
vertical_scale * 180,
horizontal_scale * 960,
vertical_scale * 720,
"A"
)
} else {
WinMove(
horizontal_scale * 360,
vertical_scale * 90,
horizontal_scale * 1200,
vertical_scale * 900,
"A"
)
}
}
}
; Shift + Alt + w
+!w:: {
if not (A_IsAdmin) {
try {
Run '*RunAs "' A_ScriptFullPath '" / restart'
}
}
}
; Ctrl + Alt + w
^!w:: {
process_name := WinGetProcessName("A")
title := WinGetTitle("A")
WinGetPos(&x, &y, &width, &height, "A")
MsgBox(
"Process Name : " process_name "`n"
"Title : " title "`n"
"Position : " x ", " y "`n"
"Size : " width " x " height,
"WinMove"
)
}