Advanced Windows Hotkeys

It seems crazy to me that people don't make more use of the Windows key + Arrow keys hotkeys. If you're unfamiliar with these, give them a try. Windows+Left and Windows+Right are by far the most useful, as they will:

Windows+Up will maximize, whereas Windows+Down will restore or minimize depending on the window's current state.

However, a common scenario for me is that I just want a little more than half the screen for code, as documentation pages tend to deal well with smaller browser sizes. Or, sometimes I have a command prompt pinned to the right, but I have to fiddle about with the mouse to fill the gap because command windows won't generally expand horizontally.

Another problem was stacking windows above each other. In an ideal world, VS would occupy 60% of the left side of my monitor, and on the remaining right side, I'd have documentation taking 70% of the top right corner and the command prompt in the bottom right 30%. With the vanilla Windows hotkeys, this is impossible with keyboard alone.

Update: Windows 10 introduced quarter-screen snapping with Windows+Up and Windows+Down too, as well as a central sizer you can manipulate with the mouse. However, being able to do it with keys is nice too.

And thus, my answer to this was to write code, culminating in this: Advanced Window HotKeys. This is a tiny app that will run in the background, and using the Alt+Arrow keys (among others) will net you some really fine-grained control over your window layout. I went one step further and the tool will also help you preserve your current layout but still allow you to resize the foreground window, moving other windows out of the way. Check out the page for more information.

screenshot

I wrote this in VS2012, C++ and Win32. Win32 really is a very powerful API. This tool makes extensive use of EnumWindows and MoveWindow to expand or contract the foreground window; search for adjacent windows to snap to; modify adjacent windows to prevent overlap;and other stuff. I threw in a little Control Panel, although that's still very primitive.

I haven't tested this on anything other than Win8, so if anyone wants to volunteer to see how this'll work on Win7 or below then please comment or email me. I'd really appreciate feedback, so you can do that using the email link at the bottom of the AWHK website.