summaryrefslogtreecommitdiff
path: root/_winresize.ahk
diff options
context:
space:
mode:
Diffstat (limited to '_winresize.ahk')
-rw-r--r--_winresize.ahk24
1 files changed, 24 insertions, 0 deletions
diff --git a/_winresize.ahk b/_winresize.ahk
new file mode 100644
index 0000000..14389f3
--- /dev/null
+++ b/_winresize.ahk
@@ -0,0 +1,24 @@
+#NoEnv
+#Warn
+SendMode Input
+SetWorkingDir %A_ScriptDir%
+
+; Not only windows titlebar and borders count towards window size
+; shadow also does, so compensate for that, width 16, height 39
+
+ResizeWin(Width = 0,Height = 0,ExtraW = 0,ExtraH = 0,WinW = 16,WinH = 39) {
+ WinGetPos,X,Y,W,H,A
+
+ if (Width == 0) {
+ Width := W
+ } else {
+ Width += ExtraW + WinW
+ }
+ if (Height == 0) {
+ Height := H
+ } else {
+ Height += ExtraH + WinH
+ }
+
+ WinMove,A,,%X%,%Y%,%Width%,%Height%
+} \ No newline at end of file