Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » How to replace OnInitMenu Collapse All
Subject Author Date
Pierre MEDART Aug 17, 2007 - 6:13 AM

We have replaced a CMenuBar with a CExtMenuControlBar.

We used to performe some customer specific operation (updating the menu depending on the other products installed) in the OnInitMenu of our application.

How can we do it again ?

Regards

Suhai Gyorgy Aug 17, 2007 - 6:30 AM

There is an article describes how to build popup menus dynamically at run time.

Pierre MEDART Aug 23, 2007 - 3:32 AM

OK let’s make things clear. It is not a pop-up menu.

We have replaced the MFC CMenuBar with a CExtMenuControlBar as described in the help delivered with ProfUI.

Previoulsy we used the OnInitMenu() to perform various action such as if the use has the Shift key down we displayed some special menu.

This no longer works since the OnInitMenu is never reached with the MenuBar.

The LRESULT CMainFrame::OnExtMenuPrepare(WPARAM wParam, LPARAM lParam) as described in the article just doesn’t work (catch it for the popup but not the mainframemenu)

How can we fix this?

Suhai Gyorgy Aug 23, 2007 - 7:50 AM

CExtMenuControlbar is derived from CExtToolControlBar, so actually the very top level menu items are toolbar buttons in this case. Read this article: Constructing Menus Dynamically at Run Time. The second chapter, called Menu Bar, talks about how to change these toolbar buttons which represent the toplevel menu items.