Programming Microsoft Visual C++
You won't get to Multiple Document Interface (MDI) applications until Chapter 18, but if you're using this book as a reference, you might want to apply the persistent frame technique to MDI applications.
The CPersistentFrame class, as presented in this chapter, won't work in an MDI application because the MDI main frame window's ShowWindow function is called, not by a virtual ActivateFrame function, but directly by the application class's InitInstance member function. If you need to control the characteristics of an MDI main frame window, add the necessary code to InitInstance.
The ActivateFrame function is called, however, for CMDIChildWnd objects. This means your MDI application could remember the sizes and positions of its child windows. You could store the information in the Registry, but you would have to accommodate multiple windows. You would have to modify the CPersistentFrame class for this purpose.
Категории