
Dynamically changing menu in MDI app
There are couple of ways to handle issues such as these. One is to handle
OnInitMenuPopUp in your MDI main frame. This may not help you because you
want to put something in the menubar itself. That leaves you with the option
of tracing the menu swapping in OnMDIActivate(). Simple option would be to
just access the menus in each of the MDI doctemplates and change it as you
want. Responsibility of managing it would be totally up to you.
--
Ajay Kalra [MVP - VC++]
Note: Please post all replies to newsgroup only.
Quote:
> I've got a typically MFC AppWizard generated MDI application.
> I have only one document type, one menu resource (okay, actually two if
you
> count the one that App wizard generates).
> So what I want to be able to do is to update the items on one of the
menus.
> The problem I'm having is that the CMainFrame window has the normal,
> FILE | EDIT |VIEW|WINDOW|HELP
> menu and my MDI documents have the same menu with an additional "TOOLS"
> menu.
> I only want the tools to show up when the documents are open.
> So far, no problem.
> The problem is based on the kind of file I open, I want to add different
> tools to the TOOLS menu, and have those tools reflected on the toolbar.
> The problem is that the toolbar isn't showing up properly, and the reason
is
> because until I actually Click on the TOOLS menu and cause it to be
> customized, it isn't actually customized. Hence the icons are greyed. :(
> How can I "catch" the menu when it changes from the default menu to the
MDI
> menu so I can customize it before a user ever clicks on it? Or am I
rambling
> too much. <g>
> Bob Cozzi