Jump to content

PMGuide - Message Processing

From EDM2

Messages are processed by window and dialog procedures.

Every window has a window procedure. Windows can also be combined into standard windows or dialog boxes. These are special cases of groups of windows that also have their own procedures. A window or dialog procedure must be capable of processing any message. This can be achieved by delegating some message types to the default window, or dialog, procedures by use of the WinDefWindowProc and WinDefDlgProc functions respectively.

Control windows are a special type of child windows. They take the form of objects such as buttons, scroll bars, list boxes, and text entry fields. These child windows process mouse and keyboard input and notify its owner of significant input events. Procedures for these child window controls are inside the Presentation Manager and are often called system-provided window procedures.

All messages have the same form as QMSG. structure.

Message Types

There are two types of window procedure message processing:

  • Default window and dialog procedure message processing
  • Control window message processing.

These types are described in Default Window and Dialog Procedure Message Processing and Control Window Message Processing. The messages are described in the message groups found on the Contents.

Default Window and Dialog Procedure Message Processing

These window procedures provide default processing for application window procedures:

  • Default window and dialog procedure
  • Language support window and dialog procedures, which are used if the application specifies a null window procedure
  • Default AVIO window procedure.

These messages are described in Default Window Procedure Message Processing. The system-provided window procedures take no action on messages that are not defined in this chapter, and return NULL.

Control Window Message Processing

Controls are predefined classes of child windows that any application can use for input and output. These control classes are predefined:

WC_BUTTON
       Consists of buttons and boxes that the operator can select by clicking the pointing device or using the keyboard. These messages are described in Button Control Window Processing. WC_CIRCULARSLIDER
       Consists of a visual component whose specific purpose is to allow a user to set, display, or modify a value by moving the slider arm around the circular slider dial. Messages are described in Circular Slider Control Window 

Messages.

WC_COMBOBOX
       Consists of an entry field control and a list box control merged into a single control. The list, which is usually limited in size, is displayed below the entry field and offset one dialog box unit to its right. These messages are described in Combination-Box Control Window Processing. 
WC_CONTAINER
       Consists of a visual component whose specific purpose is to hold objects such as executable programs, word processing files, graphics images, and database records. Messages are described in Container Control Window Processing. 
WC_ENTRYFIELD
       Consists of a single line of text that the operator can edit. These messages are described in Entry Field Control Window Processing. 
WC_FRAME
       Consists of a composite window. These messages are described in Frame Control Window Processing. 
WC_LISTBOX
       Presents a list of text items from which the operator can make selections. These messages are described in List Box Control Window Processing. 
WC_MENU
       Presents a list of items, which may be text displayed horizontally as action bars or vertically as pull-down menus. Menus are usually used to provide a command interface to applications. These messages are described in Menu Control Window Processing. 
WC_MLE
       Consists of a rectangular window that displays multiple lines of text that the operator can edit. When it has the focus, the cursor marks the current insertion or replacement point. These messages are described in Multi-Line Entry Field Control Window Processing. 
WC_NOTEBOOK
       Consists of a visual component whose specific purpose is to organize information on individual pages so that a user can find and display that information quickly and easily. Messages are described in Notebook Control Window Processing. 
WC_SCROLLBAR
       Consists of window scroll bars that allow the operator to make a request to scroll the contents of an associated window. These messages are described in Scroll Bar Control Window Processing. 
WC_SLIDER
       Consists of a visual component whose specific purpose is to allow a user to set, display, or modify a value by moving the slider arm along the slider shaft. Messages are described in Slider Control Window Processing. WC_SPINBUTTON
       Presents a scrollable ring of choices from which the operator can select. These messages are described in Spin Button Control Window Processing. 
WC_STATIC
       Consists of simple display items that do not respond to keyboard or pointing device events. These messages are described in Static Control Window Processing. 
WC_TITLEBAR
       Displays the window title or caption and allows the operator to move its owner. These messages are described in Title Bar Control Window Processing. 
WC_VALUESET
       Consists of a visual component whose specific purpose is to allow a user to select one choice from a group of mutually exclusive choices. A value set can use graphical images (bit maps or icons), as well as colors, text, and numbers, to represent the items that a user can select. Messages are described in Value Set Control Window Processing. 
Owner-Notification Messages

Controls are useful because they notify their owners when significant events take place. A control notifies its owner by sending a WM_CONTROL message or by posting a WM_COMMAND or WM_HELP message.

WM_CONTROL
WM_COMMAND
       Param2 contains information that indicates the source of the WM_COMMAND message:
           CMDSRC_PUSHBUTTON
               Posted by a pushbutton control CMDSRC_MENU
               Posted by a menu control CMDSRC_ACCELERATOR
               Posted by WinTranslateAccel CMDSRC_FONTDLG
               Posted by a font dialog. CMDSRC_OTHER
               Other source.
WM_HELP
Param1 contains information that indicates the source of the WM_HELP message:
CMDSRC_PUSHBUTTON
   Posted by a pushbutton control 
CMDSRC_MENU
   Posted by a menu control 
CMDSRC_ACCELERATOR
   Posted by WinTranslateAccel 
CMDSRC_OTHER
   Other source.

Notation Conventions

Each message description contains:

Name
       The message name; a 2-byte identity unique to a message.
       Some message identity values are reserved for the use of the operating system, some are available for use by an application. See Reserved Messages under Default Window Procedure Message Processing.
       For all messages, the first two or three characters of the name indicate the type of window that is related to the message; for example:
LM
           List box control 
SBM
           Scroll bar control. 
Cause
           The principal reason that caused the generation of the message. 
Parameters
           Input and output parameters pertinent to the message.
           There are always two parameters (param1 and param2) and one return value. Any or all of the parameters can be NULL. 
Remarks
           An explanation of the relationship between the parameters in the context of the message and an indication of the expected processing of the message. 
Default
           A definition of how the default window procedures (provided by the system) process the message. 

Note: A message is not equivalent to a call of the same name.