Maybe it's just in my system, but - always when I maximize a program,
bottom ends up two pixels below taskbar top. Same for all app's, except
one, a 16-bit Word Processor I once wrote. That one resizes properly
on maximize and leaves a clear 3D border against taskbar. Weird..
So I tried to fix my 32-bit PB app's by trapping %WM_GETMINMAXINFO and
decrease ptMaxSize. Looked at given values and discovered ptMaxSize.y
is set to screen height + 8. However, nothing changes until I reset it
to a value below screen height - taskbar height.
Then it works, but now I suddenly get a max that is a couple of pixels
above taskbar? Tried to do same stunt in %WM_WINDOWPOSCHANGING and
%WM_WINDOWPOSCHANGED, but same result - either a couple of pixels below
or above, never exact.
Seems like Windows does additional calculation after all messages are
sent and then misses 2 pixels. Funny that my 16-bit app' manages to
fool Windows - indicates it's a 32-bit "issue". Even funnier is that
not all 16-bit app's handles it properly, only that one. Indicates it
isn't just a 32-bit issue after all. Sigh..
Maybe it is a Win95/98 thing only? Not really important, but would be
fun to find a fix for it. Made a small test if anyone is interested.
Taskbar needs to be at bottom for this one..
------------------
bottom ends up two pixels below taskbar top. Same for all app's, except
one, a 16-bit Word Processor I once wrote. That one resizes properly
on maximize and leaves a clear 3D border against taskbar. Weird..
So I tried to fix my 32-bit PB app's by trapping %WM_GETMINMAXINFO and
decrease ptMaxSize. Looked at given values and discovered ptMaxSize.y
is set to screen height + 8. However, nothing changes until I reset it
to a value below screen height - taskbar height.
Then it works, but now I suddenly get a max that is a couple of pixels
above taskbar? Tried to do same stunt in %WM_WINDOWPOSCHANGING and
%WM_WINDOWPOSCHANGED, but same result - either a couple of pixels below
or above, never exact.
Seems like Windows does additional calculation after all messages are
sent and then misses 2 pixels. Funny that my 16-bit app' manages to
fool Windows - indicates it's a 32-bit "issue". Even funnier is that
not all 16-bit app's handles it properly, only that one. Indicates it
isn't just a 32-bit issue after all. Sigh..
Maybe it is a Win95/98 thing only? Not really important, but would be
fun to find a fix for it. Made a small test if anyone is interested.
Taskbar needs to be at bottom for this one..
Code:
'¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ ' DDT TEMPLARE '¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ #COMPILE EXE #INCLUDE "WIN32API.INC" DECLARE CALLBACK FUNCTION DlgCallback() '¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ ' PBMAIN - build dialog and controls '¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ FUNCTION PBMAIN LOCAL hDlg AS LONG DIALOG NEW 0, "Maximize test",,, 240, 100, %WS_OVERLAPPEDWINDOW TO hDlg DIALOG SHOW MODAL hDlg CALL DlgCallback END FUNCTION '¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ ' MAIN DIALOG'S CALLBACK PROCEDURE '¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ CALLBACK FUNCTION DlgCallback() SELECT CASE CBMSG CASE %WM_GETMINMAXINFO LOCAL rc AS RECT, mmi AS MINMAXINFO PTR SystemParametersInfo %SPI_GETWORKAREA, 0, BYVAL VARPTR(rc), 0 mmi = CBLPARAM MSGBOX "@mmi.ptMaxSize.y =" + STR$(@mmi.ptMaxSize.y) + $CRLF + _ "rc.nBottom =" + STR$(rc.nBottom) @mmi.ptMaxSize.y = rc.nBottom - 1 'change to -0 and see what happens, in spite the 'fact that rc.nBottom is much less that mmi value.. END SELECT END FUNCTION
------------------
Comment