Programming with Microsoft Visual C++.NET 6ed [Electronic resources]

George Shepherd, David Kruglinski

نسخه متنی -صفحه : 319/ 124
نمايش فراداده

The <i class="emphasis">CPersistentFrame</i> Class

The CPersistentFrame Class

In this chapter, we'll use a class named CPersistentFrame that's derived from the CFrameWnd class. This CPersistentFrame class supports a persistent Single Document Interface (SDI) frame window that remembers the following characteristics:

  • Window size

  • Window position

  • Maximized status

  • Minimized status

  • Toolbar and status bar enablement and position

When you terminate an application that's built with the CPersistentFrame class, the above information is saved on disk in the Windows Registry. When the application starts again, it reads the Registry and restores the frame to its state at the previous exit.

You can use the persistent view class in any SDI application, including the examples in this book. All you have to do is substitute CPersistentFrame for CFrameWnd in your application's derived frame class files.