I migrated my MFC MDI application to use the new MFC Feature Pack. I have many toolbars and dockable panes. As far as I understand, the location and size of each of them is saved in the registry when closing the application, and loaded when loading the main frame.
I want to add a feature in my application to reset the layout of the toolbars/panes to the original layout.
I have tabbedpanes also in my application.
sometimes I will dock separate panes to tabbed panes.
Is there a way to actually reset the layout of my application AFTER it has been loaded?
Visual Studio has a similar feature called "Reset Window Layout".
I am getting samples in the internet for restoring mainframe window using SetWindowPlacement() and GetWindowPlacement().
I don't know how to use these functions for toolbars and CDockablePanes and achieve my requirement?
Is there any other solution apart from using SetWindowPlacement() and GetWindowPlacement()?
As described in my comment above, one option to restore the initial layout from a running application would be to use the methods provided by
CDockablePane, specificallyAttachToTabWindowDockToWindowandShowPaneA second option, which would require restarting your application, is to call
EnableLoadDockState(FALSE)in the constructor of yourCFrameWndExderived class. This would prevent loading the stored dock state and, as a consequence, restore the initial layout.