5

How do you disable the Maximize button/capability in an SDI application?

OregonGhost
  • 23,359
  • 7
  • 71
  • 108
  • are you talking about a dialog or a SDI application ? you should edit the title. – Max May 25 '09 at 10:38
  • 1
    I 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 Answers3

7

For completeness:

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    ModifyStyle(WS_MAXIMIZEBOX, 0);

    <etc...>
}
Roel
  • 19,338
  • 6
  • 61
  • 90
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

Druid
  • 6,423
  • 4
  • 41
  • 56
ramit
  • 51
  • 1
  • 1
0

You can see it here: How to disable maximize in SDI application

Naveen
  • 74,600
  • 47
  • 176
  • 233