ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

WinFill - better than Aero Snap?

(1/2) > >>

skrommel:
 :) 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

kartal:
Hi

It does not do anything under vista? I cannot make it work. Might it be a code copy paste problem?

kartal:
Btw check this app, this one has been around for a while and does the same thing pretty much


http://winsplit-revolution.com/

skrommel:
 :tellme: That's odd, I'm running Vista, too. It should just be a matter of taking a window by it's caption and dropping it on a screen edge. Try the upper left corner and let me know.

Skrommel

nudone:
no one heard of 'gridmove' https://www.donationcoder.com/forum/index.php?topic=3824.0 around here? the original idea was for resizing the window by dragging to the edge of the screen - but it grew into a program that did far more than that. (i know Skrommel saw the original post as there's a comment about 'ZoneSize'.)

having said that. i thought aerosnap worked well on vista - but it seems to crash. so, i'll give 'winfill' a try.

Skrommel, just wondering, does 'winfill' do the auto resize to original window size when you drag the window back into the center of the screen? that seemed to be one of the best features of 'aerosnap'.

Navigation

[0] Message Index

[#] Next page

Go to full version