![]() |
MDIMenu Reset |
Post Reply ![]() |
Author | |
cradke ![]() Groupie ![]() Joined: 14 August 2007 Status: Offline Points: 17 |
![]() ![]() ![]() ![]() ![]() 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?)
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |