probably because MS think maximize *is* maximize and should never
be possible to resize. If border is visible, possible to resize.
Must be why they also set other borders outside screen (-4).
Probably just lazy MS - they could have solved this better. Also found
that 16-bit app's talk another dialect and can fool 32-bit system. In
my 16-bit code, I do WM_MDIMAXIMIZE on MDI parent in WM_SIZE, and that
gives same result as Semen's solution, but with similar 32-bit code,
it does not.
One backside of Semen's solution is visible sizegrips. System must be told
window is maximized, but then system overrides resize and sets own maximize
again. Don't understand Windows, so think I'll skip it, at least for now.
Not really important..

BTW, here's more complete code that handles different taskbar positions.
Code:
Case %WM_SYSCOMMAND If (CbWparam And &HFFF0) = %SC_MAXIMIZE Then Local rc As RECT : STATIC rcNormal AS RECT, mState AS LONG If mState = 0 Then GetWindowRect CbHndl, rcNormal SystemParametersInfo %SPI_GETWORKAREA, 0, ByVal VarPtr(rc), 0 rc.nLeft = rc.nLeft - 4 rc.nTop = rc.nTop - 4 rc.nRight = rc.nRight + 4 rc.nBottom = rc.nBottom + 4 IF rc.nBottom - 4 < GetSystemMetrics(%SM_CYSCREEN) THEN rc.nBottom = rc.nBottom - 3 ELSEIF rc.nRight - 4 < GetSystemMetrics(%SM_CXSCREEN) THEN rc.nRight = rc.nRight - 3 ELSEIF rc.nTop + 4 > 0 THEN rc.nTop = rc.nTop + 3 rc.nBottom = rc.nBottom - 4 ELSEIF rc.nLeft + 4 > 0 THEN rc.nLeft = rc.nLeft + 3 END IF Else rc = rcNormal END IF mState = 1 - mState SetWindowPos CbHndl, 0, rc.nLeft, rc.nTop, _ rc.nRight - rc.nLeft, rc.nBottom - rc.nTop, _ %SWP_NOZORDER Or %SWP_NOACTIVATE Function = 1 End If
------------------
Leave a comment: