Remember window position
john-peterson opened this issue · 1 comments
Remember window position
Solution
A window position should be remembered because
- a user often want to use the same window position for a process
- some programs don't save size and position, f.e.
- explorer.exe, winword.exe (opens additional windows 25 px right of the previous window)
- mintty.exe (doesn't save position)
Implementation
It should be implemented as
- saving the location when a window is sized (a hotkey is pressed)
- listen for window creation (to detect match against saved positions) with http://www.autohotkey.com/board/topic/59059-wintrigger-watch-deactivationunexistance-of-windows
Identification by process name (rather than also window title and class name) is adequate because
- it's rarely of interest to differentiate based on window title or class name
To solve this same problem, I use 'Toggle' AHK actions which launch+move windows to where I want them. If the window is already opened, the script simply does a Show/Hide toggle on it. I've been using this for years so I have a 'hotkey' for each of the primary applications I use (File Browser, Web Browser, Notepad++, etc), but it also doubles as a 'location' memory for each of these since the script always re-positions & re-sizes these windows.
It's not a generic solution by any means, but if you happen to still be interested in something to save window positions, let me know and I'll post the relevant sections of my script for you to use.