Messages passed to a window may be processed in one of two basic ways:
Synchronous and asynchronous processing are described in more detail in Window Procedures (Invoking a Window Procedure).
A message may also be dispatched to multiple windows at the same time, using the message broadcasting facilities provided by the Presentation Manager programming interface. Broadcasting may be either synchronous or asynchronous. The implementation of message broadcasting is discussed in more depth in Window Communication.
Messages that are not explicitly processed by an application in its window procedures are passed to a default window procedure supplied by Presentation Manager, which contains default processing for all message classes (in the case of application-defined message classes, this default window procedure simply ignores the message). This technique is in accordance with the principle of inheritance, in that a window procedure only contains methods for those message classes with which it is directly concerned, and allows other messages to be processed by the existing default window procedure. Default processing for each message class is described in the IBM OS/2 Version 2.0 Presentation Manager Reference.
For message classes that are processed by the application's window procedures, the last operation in the message processing should be to provide a return code to Presentation Manager. In many cases, this return code determines whether Presentation Manager performs its default message processing, after the application's own message processing is complete. The default message processing may or may not be desirable, depending upon application requirements. This ability allows system-initiated events to be easily detected and trapped by a Presentation Manager, enabling the application to perform its own processing for the event before allowing the default processing to occur.