Command Bars has three ways for developers to add MDI Menu customization menus. This tutorial assumes that you have already created an application with customization. Click here for more information about this.
This method uses the MFC architecture for MDI menus, you just need to add standard customization without additional changes. As in a standard MFC application, you must add templates for each MDI document typeAdvantages: Disadvantages: Notes:
All you need is to add the xtpFlagIgnoreSetMenuMessage flag to the Menu Bar:
CXTPCommandBar* pMenuBar = pCommandBars->SetMenu( _T("Menu Bar"), IDR_CUSTOMTYPE); pMenuBar->SetFlags(xtpFlagIgnoreSetMenuMessage);
and all other menu templates will be ignored.Advantages: Disadvantages Notes:
This is the most difficult for developers, but the most friendly type for user customization.
Developers must create only one Menu template with all popup items needed to be used in the application, and assign programmatically what popup items are shown in each template.
For example developers must add the ‘Window’ item but assign it to show only when some documents are visible.
For this customization type add ExcludeDocTemplate and AssignDocTemplate methods of CXTPControl class.Advantages: Disadvantages Notes:
See Also: Add customization to menus and toolbars