Click to See Complete Forum and Search --> : How to remove menu from MDI application.
pabitradash
November 15th, 2001, 04:17 PM
My application is MDI app.
How can I remove the remove the mainframe
menu and child frame menu before showing the
application.
PDash
snoopy779ind
November 19th, 2001, 05:06 AM
try using this in your Framewind derived class's OnCreate(LPCREATESTRUCT lpCreateStruct) function
CMenu* pMenu;
pMenu = GetMenu();
while (pMenu->RemoveMenu(0,MF_BYPOSITION))
{
CWnd::DrawMenuBar();
}
snoopy779ind
November 19th, 2001, 05:58 AM
You will also have to add the following code in the winapp derived class's InitInstance() function
CMenu* pMenu;
pMenu = ((CFrameWnd*) AfxGetMainWnd())->GetMenu();
if (pMenu)
{
while (pMenu->RemoveMenu(0,MF_BYPOSITION))
{
((CFrameWnd*) AfxGetMainWnd())->DrawMenuBar();
}
}
pabitradash
November 20th, 2001, 12:52 PM
I removed the menu resource corresponding to the
document window.
PDash
codeguru.com
Copyright 2007 Jupitermedia Corporation All Rights Reserved.