Windows

A window is the primary input and output device of any Windows application. It is an application's only access to the system display. A window is a combination of a title bar, a menu bar, scroll bars, borders, and other features that occupy a rectangle on the system display. You specify the features you want for a window when you create the window. Windows then draws and manages the window. Figure 13.1 shows the main features of a window:

Although an application creates a window and technically has exclusive rights to it, the management of the window is actually a collaborative effort between the application and Windows. Windows maintains the position and appearance of the window, manages standard window features such as the border, scroll bars, and title, and carries out many tasks initiated by the user that directly affect the window. The application maintains everything else about the window. In particular, the application is responsible for maintaining the “client area” of the window (the portion within the window borders). The application has complete control over the appearance of its window's client area.

To manage this collaborative effort, Windows advises each window of changes that might affect it. Because of this, every window must have a corresponding “window function.” The window function receives window-management messages that it must respond to appropriately. Window-management messages either specify actions for the function to carry out, or are requests for information from the function.