Quote:
Unless I'm missing something, it looks like there's no problem with moving maximized windows instantly.
Not really a problem, just me being nitpicky. I can see the intermediate moves (maximized -> restored, move, restored -> maximized), and that bothers me. More importantly, it seems the WinRestore,WinMaximize hack has another negative side-effect (at least on Vista): after moving a maximized window from one screen to the other, if I restore the window... it extends outwards. That is, it ends up larger than the screen.
(Edit: Disregard that - I was erroneously using the window's
maximized size in calculations.)
I think the solution may be SetWindowPlacement:
MSDN wrote:
The SetWindowPlacement function sets the show state and the restored, minimized, and maximized positions of the specified window.
It might even be possible to move maximized windows without restoring them first.
Progress report: 
The "hotkey customization system" is virtually complete. The implementation is so abstract that the hotkey initialization can be done in one line:
Code:
Hotkey_Params(WindowPad_INI_GetList(ininame, "Hotkeys", "Hotkey"))
WindowPad_INI_GetList() gets a list of "Hotkey" values from the "Hotkeys" section of the ini file. Examples:
Code:
[Hotkeys]
Hotkey= #Numpad1:: WindowPadMove, -1, +1, 0.5, 0.5
Hotkey= #Numpad2:: WindowPadMove, 0, +1, 1.0, 0.5
Hotkey= #Numpad3:: WindowPadMove, +1, +1, 0.5, 0.5
...
Hotkey= #NumpadDiv:: GatherWindows, 2
Hotkey= #NumpadMult:: GatherWindows, 1
(All of the hotkeys are customizable this way.)Hotkey_Params() then maps the hotkeys to their associated "commands." Commands are implemented as labels, with the parameter list stored in
Params, and parsed as needed by the "command." Commands can be added arbitrarily, and hotkeys can be added to move a window ("A", "P" (WinPreviouslyActive()) or by title) in one of nine directions (counting "center" as a direction) and sizing to any factor of the screen size (0.0 - 1.0; values > 1.0 will be interpreted as absolute sizes.)
In hindsight, all that would've already been possible by editing the script itself,
Code:
#Left::MoveWindowInDirection(-1, 0, 0.5, 1.0)
however, that wouldn't allow customization after the script is compiled. Storing the settings in an .ini file would also allow per-user configurations, though I haven't implemented that.
Next comes the GUI for configuration, possibly* in the form of a "wizard" - set your main "pad" keys, prefix keys (for the active window or the window beneath it), and utility keys (maximize, move to next screen, etc.) Advanced configuration (additional hotkeys) will probably be left in the form of a text editor.
* feedback welcome.
I also plan to eventually implement JOnGliko's double-click idea, a minimize hotkey of some form, and co-operative resize (my name for ezuk's idea.)
Dave Campbell wrote:
Is there any advantage of the Hotkey command over the other method? Any particular reason why you use it extensively in WindowPad in instead of the other?
Yes - it is the only way to allow hotkeys to be customized without editing the script itself.
Dave Campbell wrote:
It makes my day to see a lot of effort pan out and become productive.
Couldn't have said it better myself.

bobbo wrote:
I think if you add some nice tray icons, add a simple GUI for configuration, and upload an exe for non-AHK users, this utility will blow these closed-source alternatives out of the water.
Lastly, if anyone has ideas for a tray icon, let's hear/see them.
