Need "always-maximized" app window that does not cover taskbar or move or change size ever but can be minimized.
Posted on 2000-04-07
I am having trouble forcing my application window to be "always maximized".
Before firing off a reference to a typical article on this, please consider the exact problems I am having. Many such articles have let me down in one way or another.
My goal is simple. I just want the app window to appear in the "standard" maximized position (NOT COVERING UP THE TASKBAR!!!) and stay that way forever except when someone minimizes the window, which should be possible. Resizing and moving, however, should be impossible.
So far I have read many detailed explanations for doing this and they all let me down in one way or another.
FYI, Here is my list of ways these well-written articles still managed to fail my simple requirements...
1) Window is always maximized, but it covers the taskbar.
2) Window is always maximized and does not cover taskbar until you move the taskbar to an odd location (e.g. top of the screen).
3) Window is always maximized, but it can be moved around.
4) Window is always maximized, but double-clicking the caption area spntaneously reduces its size and there is no way back to the maximume size.
5) Window appears non-maximized for a brief moment during application startup.
I have tried overloading
void CMainFrame::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
but I can never get it all working together.
The hardest part seems to be retaining the "standard" size for maximized state while removing/disabling the maximize-button, which should be removed to emphasize that resizing is not possible. It seems like this necesatates an overload for OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI). However, the examples for doing this never seem to account for the possibility that the maximize-button is disabled, which (don't ask me why?) alters the default behavior for sizing the maximized window.
Thanks for your interest in this,