Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - MDIMenu Reset
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

MDIMenu Reset

 Post Reply Post Reply
Author
Message
cradke View Drop Down
Groupie
Groupie


Joined: 14 August 2007
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote cradke Quote  Post ReplyReply Direct Link To This Post Topic: MDIMenu Reset
    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?)
 
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.031 seconds.