### Windows

When you develop an application, you usually start with a window that is a composite of a frame window, title bar, menu bar, system menu, maximize and minimize buttons, client window, and extensions. The frame window coordinates the actions of the frame extensions and client window, enabling the composite window to act as a single unit. A frame's client window is the control that corresponds to the rectangular portion of the frame window not occupied by other controls (menus or buttons).

#### Frame Windows

A frame window is a window that an application uses as the base when constructing a main window or other composite window, such as a dialog window or message box. A frame window provides basic features, such as borders and a title bar. It can also have a set of resources associated with it, such as icons, menus, and accelerators.

The hierarchy shown below shows how classes are derived from parent classes. This is not a complete hierarchy because the parent classes for IHandler and IWindow are not shown. However, the diagram gives you an idea about how classes are derived for a basic window.

The parent window is used mainly for window location. For example, most frame windows have the desktop as a parent so that they can appear anywhere on the desktop. A child window is a window that is only visible inside of another window, the parent. The child is "clipped" to its parent, meaning it is confined within it, and it cannot move beyond the boundaries of the parent window.

The owner window is mainly used for message passing. Several messages are passed up the owner chain for processing and changes to color and font are passed down the owner chain. A parent window must be an owner window.

When you move an owner window, all of the windows that it owns are moved as well except if the IFrameWindow::noMoveWithOwner style is specified.

On all other environments, noMoveWithOwner is the default and cannot be changed.

Windows does not allow the owner of a top-level window to be modified after the window is created. Child window owners can be changed using the Open Class Class Library but not when using native Windows calls.

A primary window has the desktop as its parent and owner. A secondary window has the desktop as its parent, but its owner is another window. A child window would have another window for its parent and owner.

Note: | A frame window can be a primary window, secondary window, or a child window.

Events and Event Handlers

Adding Events and Event Handlers
Using Common Dialogs
Adding Toolbars

IAccelerator
ICommandHandler
IFileDialog
IFontDialog
IFrameWindow
ITitle
IWindow