参考链接:如何去除MFC窗口的自动记忆功能
程序开始函数:CmyApp::InitInstance
程序结束函数:CmyApp::ExitInstance
加入代码:
BOOL CmyApp::InitInstance() { ... m_bSaveState = FALSE;//设置为TRUE,则自动保存界面记忆 ... } int CmyApp::ExitInstance() { ... CleanState();//从Windows注册表移除了有关应用程序的所有信息 ... }
程序在运行之后将运行信息写进注册表,而程序在退出的时候没有清理掉这些信息,从而导致了在以后程序运行时依然调用前面注册表里边留下的信息去完成界面的初始化以及更新等工作。
我们应该需要的是让程序在运行的时候调用我们最新的配置或者修改信息,而不是以前的信息。