;ZoneSize.ahk ; Define zones that autosize windows dropped on them ;Skrommel @2006 FileInstall,pop.wav,pop.wav #SingleInstance,Force CoordMode,Mouse,Screen CoordMode,Pixel,Screen SetWinDelay,0 SetTitleMatchMode,2 applicationname=ZoneSize OnMessage(0x001a,"WM_SETTINGCHANGE") Gosub,INIREAD Gosub,TRAYMENU Gosub,CREATE showing=0 moving=0 counter=0 Loop { Sleep,100 GetKeyState,lbutton,LButton,P If (lbutton="U") MouseGetPos,,,mwinid MouseGetPos,mx,my oldwx:=wx oldwy:=wy oldww:=ww oldwh:=wh WinGetPos,wx,wy,ww,wh,ahk_id %mwinid% WinGetClass,mclass,ahk_id %mwinid% WinGetTitle,mtitle,ahk_id %mwinid% oldawinid:=awinid WinGet,awinid,Id,A WinGetClass,aclass,ahk_id %awinid% If (aclass="Shell_TrayWnd" Or aclass="Progman" Or awinid=guiid) awinid:=oldawinid If (lbutton="D") If mclass Not In %ignoreclass% If mtitle Not Contains %ignoretitle% If (ignoreempty=0 Or mtitle<>"") If (mx>=wx And mx=wy And myoldwx+dragx Or wyoldwy+dragx)) { WinMove,ahk_id %guiid%,,0,0,%workareaRight%,%workareaBottom% showing=1 } If (showzones=0 Or showing=1) If (wxoldwx-dragx And wyoldwy-dragy) { counter+=1 If (counter>delay) { Loop,%zonecount% { zonel:=zone%A_Index%_1 zonet:=zone%A_Index%_2 zoner:=zone%A_Index%_3 zoneb:=zone%A_Index%_4 If (mx>zonel And mxzonet And myzonel And mxzonet And my,,, Gui,Add,Text,xp y+0,%A_Space%or`t`%,`%,`%,`% Gui,Add,CheckBox,xm+10 yp+20 Checked%showzones% vvshowzones,&Show zones Gui,Add,GroupBox,xm y+10 w310 h50,Time to hover before sizing (1/10 of a second) Gui,Add,Edit,xm+10 yp+20 w100 vvdelay Gui,Add,UpDown,Range0-999,%delay% Gui,Add,GroupBox,xm y+10 w310 h85,&Classes to ignore Gui,Add,Edit,xp+10 yp+20 w290 h40 vvignoreclass,%ignoreclass% Gui,Add,Text,xp y+5,Format: , Gui,Add,GroupBox,xm y+10 w310 h105,&Part of window titles to ignore Gui,Add,Edit,xp+10 yp+20 w290 h40 vvignoretitle,%ignoretitle% Gui,Add,Text,xp y+5,Format: , Gui,Add,CheckBox,xm+10 y+5 Checked%ignoreempty% vvignoreempty,&Ignore titleless windows Gui,Add,Button,y+20 w75 Default GSETTINGSOK,&OK Gui,Add,Button,x+5 w75 GSETTINGSCANCEL,&Cancel Gui,Show,,%applicationname% Settings Return SETTINGSOK: Gui,Submit Stringreplace,vzones,vzones,`n,|,All Loop { IfNotInString,vzones,|| Break Stringreplace,vzones,vzones,||,|,All } delay:=vdelay showzones:=vshowzones zones:=vzones ignoreclass:=vignoreclass ignoretitle:=vignoretitle ignoreempty:=vignoreempty Gosub,INIWRITE Gosub,CREATE Return SETTINGSCANCEL: Gui,Destroy Return ABOUT: Gui,99:Destroy Gui,99:Margin,20,20 Gui,99:Add,Picture,xm Icon1,%applicationname%.exe Gui,99:Font,Bold Gui,99:Add,Text,x+10 yp+10,%applicationname% v1.0 Gui,99:Font Gui,99:Add,Text,y+10,Define zones that autosize windows dropped on them. Gui,99:Add,Text,y+5,- Hold a window over a zone for .5 sec to autosize it. Gui,99:Add,Text,y+5,- Doubleclick the tray icon to center the active window. Gui,99:Add,Text,y+5,- Change the settings using Settings in the tray menu. Gui,99:Add,Picture,xm y+20 Icon5,%applicationname%.exe Gui,99:Font,Bold Gui,99:Add,Text,x+10 yp+10,1 Hour Software by Skrommel Gui,99:Font Gui,99:Add,Text,y+10,For more tools, information and donations, please visit Gui,99:Font,CBlue Underline Gui,99:Add,Text,y+5 G1HOURSOFTWARE,www.1HourSoftware.com Gui,99:Font Gui,99:Add,Picture,xm y+20 Icon7,%applicationname%.exe Gui,99:Font,Bold Gui,99:Add,Text,x+10 yp+10,DonationCoder Gui,99:Font Gui,99:Add,Text,y+10,Please support the contributors at Gui,99:Font,CBlue Underline Gui,99:Add,Text,y+5 GDONATIONCODER,www.DonationCoder.com Gui,99:Font Gui,99:Add,Picture,xm y+20 Icon6,%applicationname%.exe Gui,99:Font,Bold Gui,99:Add,Text,x+10 yp+10,AutoHotkey Gui,99:Font Gui,99:Add,Text,y+10,This tool was made using the powerful Gui,99:Font,CBlue Underline Gui,99:Add,Text,y+5 GAUTOHOTKEY,www.AutoHotkey.com Gui,99:Font Gui,99:Show,,%applicationname% About hCurs:=DllCall("LoadCursor","UInt",NULL,"Int",32649,"UInt") ;IDC_HAND OnMessage(0x200,"WM_MOUSEMOVE") Return 1HOURSOFTWARE: Run,http://www.1hoursoftware.com,,UseErrorLevel Return DONATIONCODER: Run,http://www.donationcoder.com,,UseErrorLevel Return AUTOHOTKEY: Run,http://www.autohotkey.com,,UseErrorLevel Return 99GuiClose: Gui,99:Destroy OnMessage(0x200,"") DllCall("DestroyCursor","Uint",hCur) Return WM_MOUSEMOVE(wParam,lParam) { Global hCurs MouseGetPos,,,,ctrl If ctrl in Static10,Static14,Static18 DllCall("SetCursor","UInt",hCurs) Return } Return