c++ - How to save layout settings of MFC application? -
i understand there functions can write windows registry, found out in new mfc project created wizard, information (like split bar position, visibility of controls) gets stored automatically (or @ least found no cwinapp::write* calls in project). since have older projects don't have behaviour need figure out how make without of project wizard. please know how work?
the mfc control state saving magic happens in 'new' mfc feature pack, in savestate methods, example cmfctoolbar::savestate.
to take advantage of you'll therefore need upgrade toolbars , menus use newer controls , upgrade application inherit cwinappex. recommend use new mfc wizard based app guide on how upgrade old mfc app.
most of information saved in cpane::savestate(), if want state of component saved, need use classes derived cpane. (for more info here class hierarchy).
the process of saving window states initiated through cframeimpl::onclosingmainframe(). function in turn calls cwinappex::savestate() saves application settings , instances of cmfctoolbar (they add global list of cmfctoolbars in call oncreate). in similar way dockable panes saved list belongs main frame. positioin , size of main frame saved. cviews , cframewnds less favored, found , tried out, information saved visibility.
Comments
Post a Comment