Waiting for Windows 7?
WinFill - Drag a window to the edges of the screen to resize it.
Idea stolen from Windows 7's Aero Snap, but with more zones.
A B C D E
F G
H I
J K M N
A = top left corner = resize to fill top left quarter of the screen
B = top left = resize to fill left half of the screen
C = top center = maximize
...
F = left top = resize to fill upper half of the screen
...
Try it!
Skrommel
;WinFill.ahk
; Drag a window to the edges of the screen to resize it
; A B C D E
;
; F G
;
; H I
;
; J K M N
;Skrommel @ 2009
#SingleInstance,Force
SetWinDelay,0
CoordMode,Mouse,Screen
;CoordMode,ToolTip,Screen
~LButton::
MouseGetPos,mx0,my0,mwin1,mctrl1
WinGetPos,wx1,wy1,ww1,wh1,ahk_id %mwin1%
mx1:=mx0-wx1
my1:=my0-wy1
Return
~LButton Up::
MouseGetPos,mx2,my2,mwin2,mctrl2
SysGet,dragx,68
SysGet,dragy,69
If (mx2>=mx0-dragx And mx2<=mx0+dragx And my2>=my0-dragy And my2<=my0+dragy)
Return
WinGet,progman,Id,Program Manager ahk_class Progman
If (progman=mwin1)
Return
WinGetPos,wx2,wy2,ww2,wh2,ahk_id %mwin1%
mx3:=mx2-wx2
my3:=my2-wy2
SysGet,monitors,MonitorCount
Loop,% monitors
{
current:=A_Index
SysGet,monitor,Monitor,% current
If (mx2>=monitorLeft And mx2<=MonitorRight And my2>=MonitorTop And my2<=MonitorBottom)
Break
}
SysGet,monitor,MonitorWorkArea,% current
;ToolTip,%current%:%monitorLeft%-%monitorTop%-%mx2%-%my2%,100,100
If (mx3<>mx1 Or my3<>my1)
Return
If (ww2<>ww1 Or wh2<>wh1)
Return
If (mx2<=monitorLeft)
{
If (my2=monitorTop) ;topleft
WinMove,ahk_id %mwin1%,,% monitorLeft,% monitorTop,% monitorRight/2,% monitorBottom/2 ;topleft
Else
If (my2>monitorTop And my2<monitorBottom/4) ;topleft
WinMove,ahk_id %mwin1%,,% monitorLeft,% monitorTop,% monitorRight,% monitorBottom/2 ;top
Else
If (my2>=monitorBottom/4 And my2<monitorBottom/4*3) ;middleleft
WinMove,ahk_id %mwin1%,,% monitorLeft,% monitorTop,% monitorRight/2,% monitorBottom ;left
Else
If (my2>=monitorBottom/4*3 And my2<monitorBottom-1) ;bottomleft
WinMove,ahk_id %mwin1%,,% monitorLeft,% monitorBottom/2,% monitorRight,% monitorBottom/2 ;bottom
Else
If (my2=monitorBottom-1) ;bottomleft
WinMove,ahk_id %mwin1%,,% monitorLeft,% monitorBottom/2,% monitorRight/2,% monitorBottom/2 ;bottomleft
}
Else
If (mx2>=monitorRight)
{
If (my2=monitorTop) ;topright
WinMove,ahk_id %mwin1%,,% monitorRight/2,% monitorTop,% monitorRight/2,% monitorBottom/2 ;topright
Else
If (my2>=monitorTop And my2<monitorBottom/4) ;topright
WinMove,ahk_id %mwin1%,,% monitorLeft,% monitorTop,% monitorRight,% monitorBottom/2 ;top
Else
If (my2>=monitorBottom/4 And my2<monitorBottom/4*3) ;middleright
WinMove,ahk_id %mwin1%,,% monitorRight/2,% monitorTop,% monitorRight/2,% monitorBottom ;right
Else
If (my2>=monitorBottom/4*3 And my2<monitorBottom-1) ;bottomright
WinMove,ahk_id %mwin1%,,% monitorLeft,% monitorBottom/2,% monitorRight,% monitorBottom/2 ;bottom
Else
If (my2=monitorBottom-1) ;bottomright
WinMove,ahk_id %mwin1%,,% monitorRight/2,% monitorBottom/2,% monitorRight/2,% monitorBottom/2 ;bottomright
}
Else
If (my2<=monitorTop)
{
If (mx2>=monitorLeft And mx2<monitorRight/4) ;topleft
WinMove,ahk_id %mwin1%,,% monitorLeft,% monitorTop,% monitorRight/2,% monitorBottom ;left
Else
If (mx2>=monitorRight/4 And mx2<monitorRight/4*3) ;topmiddle
WinMove,ahk_id %mwin1%,,% monitorLeft,% monitorTop,% monitorRight,% monitorBottom ;full
Else
If (mx2>=monitorRight/4*3 And mx2<=monitorRight) ;bottom
WinMove,ahk_id %mwin1%,,% monitorRight/2,% monitorTop,% monitorRight/2,% monitorBottom ;right
; WinMove,ahk_id %mwin1%,,% monitorLeft,% monitorBottom/2,% monitorRight,% monitorBottom/2 ;topright
}
Else
If (my2>=monitorBottom-1)
{
If (mx2>=monitorLeft And mx2<monitorRight/4) ;bottomleft
WinMove,ahk_id %mwin1%,,% monitorLeft,% monitorTop,% monitorRight/2,% monitorBottom ;left
Else
; If (mx2>=monitorRight/4 And mx2<monitorRight/4*3) ;bottommiddle
; WinMinimize,ahk_id %mwin1% ;WinMove,ahk_id %mwin1%,,% monitorLeft,% monitorTop,% monitorRight,% monitorBottom ;full
; Else
If (mx2>=monitorRight/4*3 And mx2<=monitorRight) ;bottom
WinMove,ahk_id %mwin1%,,% monitorRight/2,% monitorTop,% monitorRight/2,% monitorBottom ;right
}
Return