Keys Extender (Win 7 Compatible)
In Windows 7, I really liked an opportunity to change the position of the windows by pressing hotkeys Win + (Left | Right | Up | Bottom):
- Win + Left - window attached to the left side
- Win + Right - window attached to the right side
- Win + Up - window is maximized
- Win + Bottom - window in the normal state
Using the Code
Making this work with Windows Vista (most likely will work in earlier versions, but I have not tried it) was not a difficult task. First of all, I imported many
WinApi functions in a WinForms application. The work was divided into two parts:
- interception of pressing the keys, and
- positioning the active window
The art Low-Level Keyboard Hook in C # helped me to solve the first part. I had only to find the way to know whether the button LWin is pressed. Here is the main code:
The second part: looking for the foreground window, setting state and size.
In addition, there is an opportunity to display (or hide) the icon in the taskbar with context menu (that can help you to close the application). You can set these options in app.config section "
- 20.04.2009 - Build version for x64 system
- 21.04.2009 - Project has new version. Now you can choose the setting, and some bugs fixed. This is the new version window: