sdi

How do you disable the Maximize button in MFC?

久未见 提交于 2020-01-03 17:01:15
问题 How do you disable the Maximize button/capability in an SDI application? 回答1: For completeness: int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { ModifyStyle(WS_MAXIMIZEBOX, 0); <etc...> } 回答2: 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

Menu items are being enabled or disabled by default. Why?

好久不见. 提交于 2019-12-12 02:17:16
问题 I have some legacy code and for some reason, menu items are being enabled or disabled on launch. My question is, how? Is there any way to do this without calling the EnableMenuItem() function? Is there a way for MFC to do the opposite from what the resource settings say? I'm also at a loss as to why the current ones are being disabled or reenabled in a SDI when the last child window has closed. This is probably due to me not understanding the framework well enough and I thought I've read