LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
// . . .
// delete memuitems
CMenuHandle menu = m_CmdBar.GetMenu();
CMenuHandle menuFile = menu.GetSubMenu (0);
menuFile.RemoveMenu (ID_FILE_NEW, MF_BYCOMMAND);
menuFile.RemoveMenu (ID_FILE_OPEN, MF_BYCOMMAND);
menuFile.RemoveMenu (ID_FILE_SAVE, MF_BYCOMMAND);
menuFile.RemoveMenu (ID_FILE_SAVE_AS, MF_BYCOMMAND);
menuFile.RemoveMenu (0, MF_SEPARATOR);
menuFile.RemoveMenu (ID_FILE_PRINT, MF_BYCOMMAND);
menuFile.RemoveMenu (ID_FILE_PRINT_PREVIEW, MF_BYCOMMAND);
menuFile.RemoveMenu (ID_FILE_PRINT_SETUP, MF_BYCOMMAND);
menuFile.RemoveMenu (0, MF_SEPARATOR);
CMenuHandle menuWindow = menu.GetSubMenu (3);
menuWindow.RemoveMenu (ID_WINDOW_CLOSE, MF_BYCOMMAND);
menuWindow.RemoveMenu (ID_WINDOW_CLOSE_ALL, MF_BYCOMMAND);
menuWindow.RemoveMenu (0, MF_SEPARATOR);
menu.DeleteMenu (1,MF_BYPOSITION); // EDIT menu
m_CmdBar.AttachMenu (menu);
// delete buttons of toolbar
CToolBarCtrl toolbar;
toolbar.Attach (hWndToolBar);
toolbar.DeleteButton (0); // NEW
toolbar.DeleteButton (0); // OPEN
toolbar.DeleteButton (0); // SAVE
toolbar.DeleteButton (0); // -
toolbar.DeleteButton (0); // CUT
toolbar.DeleteButton (0); // COPY
toolbar.DeleteButton (0); // PASTE
toolbar.DeleteButton (0); // -
toolbar.DeleteButton (0); // PRINT
toolbar.Detach ();
return 0;
}