muncherw Posted June 8, 2009 Share Posted June 8, 2009 (edited) I like the way, in Windows 7, that you can drag a window to either side of the screen and it will make it take up half the window. Since I don't have Windows 7, this is what I made for myself. Have this run in the background and then move your windows. #include <Misc.au3> Opt("WinTitleMatchMode", 4);1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase $TaskPos = ControlGetPos("classname=Shell_TrayWnd", "", "ToolbarWindow322") $size = WinGetPos("[active]") While 1 $size = WinGetPos("[active]") Sleep(25) If $size[0] < -50 Then;Dock the left side MouseUp("left") ;Stop the user from dragging the window WinMove("[active]", "", 0, 0, @DesktopWidth / 2, @DesktopHeight - $TaskPos[3]) EndIf If $size[0] + $size[2] > @DesktopWidth + 50 Then;Dock the right side MouseUp("left") ;Stop the user from dragging the window WinMove("[active]", "", @DesktopWidth / 2, 0, @DesktopWidth / 2, @DesktopHeight - $TaskPos[3]) EndIf WEnd Edit:Removed unnecessary code. Edited June 9, 2009 by muncherw Other People's Stuff:Andy Flesner's AutoIt v3: Your Quick Guide[topic="34302"]Locodarwin's ExcelCom_UDF[/topic][topic="61090"]MrCreatorR's Opera Library[/topic] Link to comment Share on other sites More sharing options...
WideBoyDixon Posted June 8, 2009 Share Posted June 8, 2009 Interesting but I think you need to cater for those people with the task bar docked somewhere other than the bottom of the window. You might also take a look at http://maxto.net/ which has some interesting options for maximising windows.WBD [center]Wide by name, Wide by nature and Wide by girth[u]Scripts[/u]{Hot Folders} {Screen Calipers} {Screen Crosshairs} {Cross-Process Subclassing} {GDI+ Clock} {ASCII Art Signatures}{Another GDI+ Clock} {Desktop Goldfish} {Game of Life} {3D Pie Chart} {Stock Tracker}[u]UDFs[/u]{_FileReplaceText} {_ArrayCompare} {_ToBase}~ My Scripts On Google Code ~[/center] Link to comment Share on other sites More sharing options...
muncherw Posted June 8, 2009 Author Share Posted June 8, 2009 Interesting but I think you need to cater for those people with the task bar docked somewhere other than the bottom of the window. You might also take a look at http://maxto.net/ which has some interesting options for maximising windows.WBDYeah, you are probably right. I should probably have it remember the size of the window so when you move it back it goes to the old size. Other People's Stuff:Andy Flesner's AutoIt v3: Your Quick Guide[topic="34302"]Locodarwin's ExcelCom_UDF[/topic][topic="61090"]MrCreatorR's Opera Library[/topic] Link to comment Share on other sites More sharing options...
Dolemite50 Posted June 9, 2009 Share Posted June 9, 2009 Thanks munch, it works fine on this end. I'll pass on buying Win7 now. BTW, I think you can lose the "user32.dll" -stuff unless you have something else up your sleeve. Keep on codin'! Link to comment Share on other sites More sharing options...
water Posted June 9, 2009 Share Posted June 9, 2009 SplitMon has some nice features to move windows around. It even supports multiple screens. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
muncherw Posted June 9, 2009 Author Share Posted June 9, 2009 Thanks munch, it works fine on this end. I'll pass on buying Win7 now. BTW, I think you can lose the "user32.dll" -stuff unless you have something else up your sleeve. Keep on codin'!Oh yeah. I was trying to use ispressed before but then realized it didn't serve my needs. Other People's Stuff:Andy Flesner's AutoIt v3: Your Quick Guide[topic="34302"]Locodarwin's ExcelCom_UDF[/topic][topic="61090"]MrCreatorR's Opera Library[/topic] Link to comment Share on other sites More sharing options...
Valuater Posted June 9, 2009 Share Posted June 9, 2009 Oh yeah. I was trying to use ispressed before but then realized it didn't serve my needs. .... and what about MouseUp("left") ?? 8) Link to comment Share on other sites More sharing options...
muncherw Posted June 9, 2009 Author Share Posted June 9, 2009 .... and what about MouseUp("left") ?? 8) When you drag the window to the place that triggers resizing and moving the window, if you are still holding the mouse down you will fight move and the window will flicker as it changes back and forth from where you are dragging to what it's trying to resize to. Simply making it think you let go of the mouse button will stop that from happening. Other People's Stuff:Andy Flesner's AutoIt v3: Your Quick Guide[topic="34302"]Locodarwin's ExcelCom_UDF[/topic][topic="61090"]MrCreatorR's Opera Library[/topic] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now