A window is the primary input and output device of any Windows application. It is an application's only access to the screen. A window consists of a title bar, a menu bar, scroll bars, borders, and other features that occupy a rectangle on the screen. When creating a window, an application specifies the window features and then draws the window. The following figure shows the main features of a window:
Although an application creates a window, the application and Windows collaborate to manage the window. Windows maintains the position and appearance of the window; manages standard window features such as the border, scroll bars, and title bar; and carries out many tasks initiated by the user that directly affect the window. The application maintains everything else about the window. In particular, it maintains and controls the appearance of the client area of the window (the portion within the window borders).
To manage this collaboration, Windows notifies each window of changes that might affect it. Each window must have a corresponding window procedure, which is a procedure that receives the window-management messages and then responds appropriately. These messages either specify actions for the procedure to carry out or are requests for information from the procedure.