How do you disable the Maximize button/capability in an SDI application?
Asked
Active
Viewed 6,680 times
5
-
are you talking about a dialog or a SDI application ? you should edit the title. – Max May 25 '09 at 10:38
-
1I edited the title. Next time, pam, please use a descriptive short version of the question as a title instead of "MFC dialog question" :) – OregonGhost May 25 '09 at 11:06
3 Answers
7
For completeness:
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
ModifyStyle(WS_MAXIMIZEBOX, 0);
<etc...>
}

Roel
- 19,338
- 6
- 61
- 90
-
1I prefer this to an external link that could be broken in the future. – Aidan Ryan May 25 '09 at 17:00
5
ModifyStyle(WS_MAXIMIZEBOX,0,SWP_FRAMECHANGED); // disable maximize
ModifyStyle(WS_MINIMIZEBOX,0,SWP_FRAMECHANGED); // disable minimize
ModifyStyle(0,WS_MAXIMIZEBOX,SWP_FRAMECHANGED); // enable maximize
ModifyStyle(0,WS_MINIMIZEBOX,SWP_FRAMECHANGED); // enable minimize
try this, should be working