Removing the close caption dynamically
Hi all,
I´m working with a MDI aplication and I have several (about 3 or 4) windows opened. the situation is if an indicated window is closed, another indicated windows cannot be closed anymore. I trying to remove its close caption but I haven´t had success. Can anyone tell me how to remove ( od disable) the close caption of a MDI child window dynamically?
Thank you in advance.
Re: Removing the close caption dynamically
How did you "try to remove its close caption"? Didi you use GetSystemMenu ? Something like this:
Code:
CMenu *pSysMenu = GetSystemMenu(FALSE);
ASSERT(pSysMenu != NULL);
VERIFY(pSysMenu->RemoveMenu(SC_CLOSE, MF_BYCOMMAND)); // or you could use CMenu::EnableMenuItem to disable it:
// pSysMenu->EnableMenuItem(SC_CLOSE, MF_GRAYED | MF_BYCOMMAND);
// ... and to enable it:
// pSysMenu->EnableMenuItem(SC_CLOSE, MF_ENABLED | MF_BYCOMMAND);