A few weeks ago, the Windows 7 Beta was released to the public - a key feature was the ability to dock windows to different parts of the screen in order to view several windows at the same time.
This incredibly simple script does the same thing, allowing you to compare documents, or view a webpage at the same time as a document. It's particularly useful when combined with a big desktop monitor.
Hotkeys may be customised via a simple, GUI interface.
If you would like the custom icon, I have packaged it with the script at
http://softwareguider.110mb.com/downloads/window_resizer.zip
I hope you enjoy ...
Code:
#singleinstance ignore
SetWorkingDir %A_ScriptDir%
FileInstall, C:\Documents and Settings\ETIENNE\Bureau\David\Website Stuff\Window Resizer\window_resizer.ico, %A_WorkingDir%\window_resizer.ico,0
IfExist, %A_WorkingDir%\window_resizer.ico
{
Menu, TRAY, Icon, %A_WorkingDir%\window_resizer.ico,,1
}
GoSub, INI
GoSub, TRAYMENU
GoSub, START
return
INI:
IfExist,WindowResizer.ini
{
IniRead,HotkeyLeft,WindowResizer.ini,Settings,HotkeyLeft
IniRead,HotkeyRight,WindowResizer.ini,Settings,HotkeyRight
IniRead,HotkeyUp,WindowResizer.ini,Settings,HotkeyUp
IniRead,HotkeyDown,WindowResizer.ini,Settings,HotkeyDown
IniRead,HotkeyMaximise,WindowResizer.ini,Settings,HotkeyMaximise
}
else
{
IniWrite,^!Left,WindowResizer.ini,Settings,HotkeyLeft
IniWrite,^!Right,WindowResizer.ini,Settings,HotkeyRight
IniWrite,^!Up,WindowResizer.ini,Settings,HotkeyUp
IniWrite,^!Down,WindowResizer.ini,Settings,HotkeyDown
IniWrite,^!1,WindowResizer.ini,Settings,HotkeyMaximise
}
return
TRAYMENU:
Menu, tray, NoStandard
Menu, tray, add, About, ABOUT
Menu, tray, add,
Menu, tray, add, Configure Shortcuts, SETTINGS
Menu, tray, add, Exit, EXIT
Menu, tray, default, About
Menu, tray, Tip,Window Resizer ~ by David Barnes
return
START:
if HotkeyLeft <>
{
Hotkey, IfWinNotActive, ahk_class AutoHotkeyGUI
Hotkey, %HotkeyLeft%, ANCHORLEFT
}
if HotkeyRight <>
{
Hotkey, IfWinNotActive, ahk_class AutoHotkeyGUI
Hotkey, %HotkeyRight%, ANCHORRIGHT
}
if HotkeyUp <>
{
Hotkey, IfWinNotActive, ahk_class AutoHotkeyGUI
Hotkey, %HotkeyUp%, ANCHORUP
}
if HotkeyDown <>
{
Hotkey, IfWinNotActive, ahk_class AutoHotkeyGUI
Hotkey, %HotkeyDown%, ANCHORDOWN
}
if HotkeyMaximise <>
{
Hotkey, IfWinNotActive, ahk_class AutoHotkeyGUI
Hotkey, %HotkeyMaximise%, ANCHORMAXIMISE
}
return
ANCHORLEFT:
WinGetTitle, Window, A
WinMove, %Window%,, 0, 0, A_ScreenWidth/2, A_ScreenHeight-32
return
ANCHORRIGHT:
WinGetTitle, Window, A
WinMove, %Window%,, A_ScreenWidth/2, 0, A_ScreenWidth/2, A_ScreenHeight-32
return
ANCHORUP:
WinGetTitle, Window, A
WinMove, %Window%,, 0, 0, A_ScreenWidth, (A_ScreenHeight-32)/2
return
ANCHORDOWN:
WinGetTitle, Window, A
WinMove, %Window%,, 0, (A_ScreenHeight-32)/2, A_ScreenWidth, (A_ScreenHeight-32)/2
return
ANCHORMAXIMISE:
WinGetTitle, Window, A
WinMove, %Window%,, 0, 0, A_ScreenWidth, A_ScreenHeight-32
return
SETTINGS:
GoSub, INI
Gui, 1: Destroy
Gui, 1: Font, s12, Arial
Gui, 1: Add, Text,,Double click to modify ...
Gui, 1: Add, ListView,h120 gEDITSETTINGS,Function|Hotkey
LV_Add("Select Focus", "Dock Left", HotkeyLeft)
LV_Add("", "Dock Right", HotkeyRight)
LV_Add("", "Dock Top", HotkeyUp)
LV_Add("", "Dock Bottom", HotkeyDown)
LV_Add("", "Maximise Window", HotkeyMaximise)
LV_ModifyCol(1, "AutoHdr")
LV_ModifyCol(2, "AutoHdr")
Gui, 1: Add, Button, default x18 w100 y160 GSAVESETTINGS, OK
Gui, 1: Add, Button, x128 w100 y160 GCANCEL, Cancel
Gui, 1: Show,, Settings
return
EDITSETTINGS:
if A_GuiEvent = DoubleClick
{
LV_GetText(RowText, A_EventInfo)
RowNumber = %A_EventInfo%
Gui, 2: Destroy
Gui, 2: Font, s12, Arial
Gui, 2: Add, Text,,Press new hotkey
Gui, 2: Add, Hotkey, w150 vHotKey
Gui, 2: Add, Button, w150 default GCHANGEHOTKEY, OK
Gui, 2: Show,, %RowText%
}
return
CHANGEHOTKEY:
Gui, 2: Submit
Gui, 1: Default
LV_Modify(RowNumber,"",RowText,Hotkey)
Gui, 2: Destroy
return
SAVESETTINGS:
LV_GetText(HotKeyLeft, 1, 2)
LV_GetText(HotKeyRight, 2, 2)
LV_GetText(HotKeyUp, 3, 2)
LV_GetText(HotKeyDown, 4, 2)
LV_GetText(HotKeyMaximise, 5, 2)
IniWrite,%HotkeyLeft%,WindowResizer.ini,Settings,HotkeyLeft
IniWrite,%HotkeyRight%,WindowResizer.ini,Settings,HotkeyRight
IniWrite,%HotkeyUp%,WindowResizer.ini,Settings,HotkeyUp
IniWrite,%HotkeyDown%,WindowResizer.ini,Settings,HotkeyDown
IniWrite,%HotkeyMaximise%,WindowResizer.ini,Settings,HotkeyMaximise
Gui, 1: Destroy
GoSub, Start
return
CANCEL:
Gui, 1: Destroy
return
EXIT:
ExitApp
return
ABOUT:
Gui, 3: Destroy
Gui, 3: Font, s13 bold, Arial
Gui, 3: Add,text,, Window Resizer
Gui, 3: Font, s11 bold, Arial
Gui, 3: Add,text,xm ym+20,by David Barnes
Gui, 3: Font, s10 norm, Arial
Gui, 3: Add,text,xm ym+50, Dock windows to the left`, right`, top `nand bottom of the screen using `nkeyboard shortcuts.
Gui, 3: Add,text,xm ym+120, Shortcuts customisable via the tray menu
Gui, 3: Add,text,xm ym+150, For more great software, be sure to visit:
Gui, 3: Font, cBlue bold underline
Gui, 3: Add,text,xm ym+170 GSOFTWAREGUIDER, www.softwareguider.110mb.com
Gui, 3: Color, White
Gui, 3: Show,, Windows Resizer
return
SOFTWAREGUIDER:
run, www.softwareguider.110mb.com
return