As mentioned in Window Procedures, window procedures within a Presentation Manager application are reentrant; that is, the same window procedure is used for multiple instances of the same window class. However, a window class may have separate data objects associated with each instance of that class, which may be used to store temporary data necessary during the existence of that object; such data is known as instance data. These data objects may need to be created/opened and initialized. Upon the window being closed, data objects may need to be closed or destroyed in a controlled fashion.
Presentation Manager allows such function to be performed by a window procedure, since messages are sent to a window by Presentation Manager informing the window procedure of events such as creation or closure of the window. These messages are discussed below.