SECToplevelFrame Class

class SECToplevelFrame: public SECFrameWnd

The SECToplevelFrame class provides the functionality of a Windows toplevel window.

Defined in: SECTLF.H

Comments

A toplevel window is a window that has no parent and floats freely on the desktop. Toplevel windows receive their own entry in the Windows 95 task bar (or Alt-Tab in Windows 3.1) and do not iconify in response to iconifying any other window. Each toplevel window can include its own menu bar, tool bar and client window. One application can open any number of toplevel windows.

An SECToplevelFrame can be used in one of two ways. First, you can define a toplevel window that embeds some arbitrary client window as its child. In this case, the SECToplevelFrame is only providing you with the capability to float the window on the desktop. Secondly, SECToplevelFrame can be combined with the CMultiDocTemplate to provide an alternative to MDI. This usage produces an application that behaves identically to MDI except that the MDI child windows have effectively been moved out of the MDI frame onto the desktop.

To convert an application from MDI to a Multiple Toplevel Window Interface, modify your application’s InitInstance member as follows:

AddDocTemplate(new CMultiDocTemplate(IDR_MYTYPE,
RUNTIME_CLASS(MyDoc),
RUNTIME_CLASS(MyToplevelFrame),
RUNTIME_CLASS(MyView)));

In addition, remove the instantiation of CMainFrame (or your equivalent class) which is normally done in OnInitInstance(). Because an SECToplevelFrame is only a slight variant of the SECFrameWnd class, you can use and derive from it just as you would any other SECFrameWnd derived class.

For example, to have a tool bar and status bar created within an SECToplevelFrame derived class, override the OnCreate() member and instantiate all desired control bars there (as is normally done).

See the SCRIBBLE sample in the \SAMPLES\TOOLKIT\STANDARD\MDI\MT_SCRIB directory for a demonstration of this class.