removing the maximize box
-
Is there a way to remove the maximize box from the view title bar in a multidoc app? I used DeleteMenu(*) or ModifyStyle(*) to disable the maximize button but these do not remove the button from the title bar. Thanks in advance.
When you create the window dont set the
WS_MAXIMIZEBOX
style, if your using MFC check under theCWnd::PreCreateWindow
method of your windows class and you can change the style from there before the window is created.Gavin Taylor
-
When you create the window dont set the
WS_MAXIMIZEBOX
style, if your using MFC check under theCWnd::PreCreateWindow
method of your windows class and you can change the style from there before the window is created.Gavin Taylor
Hmmm, I tried that in the CMainFrame::PreCreateWindow(CREATESTRUCT& cs) by setting: cs.style &= ~WS_MAXIMIZEBOX before the call to CMDIFrameWnd::PreCreateWindow(cs) which disabled the maximize box but did not remove the button from the title bar. Am I doing that wrong?
-
Is there a way to remove the maximize box from the view title bar in a multidoc app? I used DeleteMenu(*) or ModifyStyle(*) to disable the maximize button but these do not remove the button from the title bar. Thanks in advance.
I think that you will need to remove them both because you cannot remove only one of them using standard API calls. I had to overcome the same problem when I was writing a window skin engine. Applications cannot create an overlapped or a popup window that contains only the Minimize or the Maximize button.[^] Best Wishes, -David Delaune