Print Page | Close Window

MDIMenu Reset

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=8147
Printed Date: 18 June 2025 at 2:03am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: MDIMenu Reset
Posted By: cradke
Subject: MDIMenu Reset
Date Posted: 24 September 2007 at 5:24pm
How do you programmatically reset the MDIMenus?
 
The MenuBarMDIMenu doesn't have a Reset method and there doesn't seem to be a way to get a CommandBar interface from an MenuBarMDIMenu object.  QueryInterface fails so does MenuBarMDIMenu.Controls.Parent.
 
The problem is with saving the Customizations of the menu.  I set StateOptions.SaveOnlyCustomized to true but all the menus are always saved unless I manually reset each menu from the Customize dialog.
 
My code goes something like this:
1) Add an mdi menu, 
pIMenuBar->GetMDIMenus()->Add(MenuBarId, _bstr_t(Name), _bstr_t()));
 
2) Add the controls to the menu.
 
3) Tell command bars these are the default values, pICommandBarControls->CreateOriginalControls();
 
4) Reset the menu so Command doesn't think it has been changed.  (How?)
 



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net