How do you disable the Maximize button in MFC?
Asked Answered
N

3

6

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

Negatron answered 25/5, 2009 at 9:58 Comment(2)
are you talking about a dialog or a SDI application ? you should edit the title.Kayceekaye
I edited the title. Next time, pam, please use a descriptive short version of the question as a title instead of "MFC dialog question" :)Hokku
K
8

For completeness:

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

    <etc...>
}
Kenosis answered 25/5, 2009 at 11:41 Comment(1)
I prefer this to an external link that could be broken in the future.Yakka
C
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

Cam answered 12/7, 2012 at 8:24 Comment(0)
B
0

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

Berri answered 25/5, 2009 at 10:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.