I have modified the original WindowPad source code to not resize windows when moving or changing monitor.
These are the steps:
Download from the link above and unzip.
To disable resizing of windows when moving edit \source\WindowPad.ahk
to change (Windows Notepad is OK):
; Move and resize.
WinMove,,, newx, newy, neww, newh
to (note the comments with ;
character) :
; Move and resize.
; WinMove,,, newx, newy, neww, newh
WinMove,,, newx, newy, w, h
and change:
wp_CalcNewSizeAndPosition:
; Calculate desired size.
neww := restore_w != "" ? restore_w : Round(monWidth * widthFactor)
newh := restore_h != "" ? restore_h : Round(monHeight * heightFactor)
to (we keep some lines by using comments too) :
wp_CalcNewSizeAndPosition:
; Calculate desired size.
; neww := restore_w != "" ? restore_w : Round(monWidth * widthFactor)
; newh := restore_h != "" ? restore_h : Round(monHeight * heightFactor)
neww := w
newh := h
- To disable resizing of windows when changing screen edit
\source\WindowPad.ahk
to change:
; Calculate new size.
if (wp_IsResizable()) {
w := Round(w*(mdw/msw))
h := Round(h*(mdh/msh))
}
to:
; Calculate new size.
if (wp_IsResizable()) {
; w := Round(w*(mdw/msw))
; h := Round(h*(mdh/msh))
w := w
h := h
}
(a rather ridiculous change this one, but it helps understanding the modification's sense)
Now you have your .ahk file that you can run if you have installed AutoHotKey. Or compile it to .exe
by using the same program (Convert .ahk to .exe
).
And a minor enhancement: These lines here are preventing to put your own icon in the tray (you can choose it when compiling the .ahk
file, but it will not appear there):
.
if A_IsCompiled ; Load icons from my custom WindowPad.exe.
{
; Default icon is 32x32, so doesn't look good in the tray.
Menu, Tray, Icon, %A_ScriptFullPath%, 2
}
else if (A_LineFile = A_ScriptFullPath)
{ ; Set the tray icon, but only if not included in some other script.
wp_SetTrayIcon(true)
; Use OnMessage to catch "Suspend Hotkeys" or "Pause Script"
; so the "disabled" icon can be used.
OnMessage(0x111, "WM_COMMAND")
}
so just comment them all:
; if A_IsCompiled ; Load icons from my custom WindowPad.exe.
; {
; ; Default icon is 32x32, so doesn't look good in the tray.
; Menu, Tray, Icon, %A_ScriptFullPath%, 2
; }
; else if (A_LineFile = A_ScriptFullPath)
; { ; Set the tray icon, but only if not included in some other script.
; wp_SetTrayIcon(true)
; ; Use OnMessage to catch "Suspend Hotkeys" or "Pause Script"
; ; so the "disabled" icon can be used.
; OnMessage(0x111, "WM_COMMAND")
; }
and now you can compile your .ahk
to a .exe
that will have your preferred icon for the file and for the tray icon (every AutoHotKey icon in the tray has the same green H
if not specified).
My compilation to .exe is working fantastic. Now WindowPad is the best program I have ever seen to move and arrange windows, even with multiple screens.
Please reports bugs if you find them.
.exe
to AutoHotKey forums repositories as long as I will know how to do it. I suppose SuperUser has no storage for files, so I can't think about another way.