Code: Select all
Select event ;...
Case #PB_Event_MoveWindow ; Window Height restore
If OldWindowH
ResizeWindow(#WIN1, #PB_Ignore, #PB_Ignore, #PB_Ignore, OldWindowH - #TaskBarHeight)
OldWindowH = 0
EndIf
Case #WM_EXITSIZEMOVE
maximized = 0
If GetWindowState(#WIN1) = #PB_Window_Maximize
maximized = 1
EndIf
OldWindowH = 0
If DesktopMouseY() = 0
OldWindowH = WindowHeight(#WIN1)
ResizeWindow(#WIN1, #PB_Ignore, 0, #PB_Ignore, DesktopHeight(0) - #TaskBarHeight)
EndIf
windowW = WindowWidth(#WIN1)
windowH = WindowHeight(#WIN1) ;for saving in Prefs.
ResizeGadget(#SPLITTER_Left,#PB_Ignore,#PB_Ignore,windowW, windowH-ToolBarH-StatusBarHeight(#STAT1) - MenuHeight())
--the #TaskBarHeight is set as a constant (mine is 67), so it may mess up with other sizes.
--there is no "preview"
--Does not do a GetCurrentDesktop() Assumes only 1 (number 0), so with two monitors of different sizes, there will be issues.
--Is not Cross-platform (?)
Right now, I like this better than not having the feature, so I thought I'd share. It took longer to make the code "pretty" than it took to actually implement it, since I stored the window sizes in my Prefs file.
If anybody cares to add missing features, I'm sure they will be appreciated as well.