I have a case where I want the menus to set the check on items using ON_UPDATE_COMMAND_UI; however, on the toolbar I'm going to use a dropdown toolbar, so I only want to select the correct toolbar item and not change its checked state.
How do I determine if the ON_UPDATE_COMMAND_UI call is for the menu-bar or the toolbar?
You can check the
m_pMenumember of the handler's givenCCmdUIparameter; if the routine was invoked for a menu item, that will be a validCMenu*pointer; if not, it will beNULL: