Hi,
I’ve tested your suite in MFC MDI and SDI application (just menu with single toolbar), and after some trial and error, everything seems to be working fine. I’ve also tried to change system menu in MDI child wnd (by default derived from CMDIFrameWnd) by implementing OnCreate() function:
int
CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
return -1;
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING | MF_ENABLED, 0x0010, "Extra Item");
pSysMenu->AppendMenu(MF_STRING | MF_CHECKED, 0x0011, "Extra Item 2");
}
return 0;
}
Everything worked fine, as expected.
However, when I include Prof-UIS in ’real-life’ project, I realized that all my system menus are unchanged in child frame windows. My child frame window class (CTabChildFrame) is derived from CFrameWnd class, and it’s created using code:
CRuntimeClass* pRuntimeClass = RUNTIME_CLASS(CTabChildFrame);
CString strWinClass = AfxRegisterWndClass(NULL, 0, 0, GetTachyonProApp()->LoadIcon(IDR_CHILDFRAME));
CTabChildFrame* pTabChildFrame = (CTabChildFrame*)pRuntimeClass->CreateObject();
pTabChildFrame ->Create(LPCSTR(strWinClass), "Tab Child Frame");
...
For completness, here is PreCreateWindow function:
BOOL
CTabChildFrame::
PreCreateWindow(
CREATESTRUCT&
cs)
{
cs.hMenu = NULL;
cs.style = WS_SYSMENU | WS_THICKFRAME;
cs.dwExStyle &= ~WS_EX_CLIENTEDGE;
cs.dwExStyle |= WS_EX_TOOLWINDOW;
return CFrameWnd::PreCreateWindow(cs);
}
I hope I’ve informed you enough,
regards,
Dejan