msgs12.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
WM_COMMAND (1.2)
Message Group  Overview                           Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_WINMESSAGEMGR
 
WM_COMMAND
usCmd = (USHORT) SHORT1FROMMP(mp1);       /* command value */
fsSource = (USHORT) SHORT1FROMMP(mp2);    /* source type   */
fPointer = (BOOL) SHORT2FROMMP(mp2);      /* pointer flag  */
 
The WM_COMMAND message is sent to a window when it has a command to report
or when a keystroke has been translated by an accelerator table into a
WM_COMMAND message.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
usCmd      Low word of mp1. Specifies the command value.
 
fsSource   Low word of mp2. Specifies the source type. This parameter can be
           one of the following values:
 
           Value               Meaning
           ─────────────────────────────────────────────────────────────────
           CMDSRC_ACCELERATOR  Posted as the result of an accelerator. The
                               usCmd parameter is the accelerator command
                               value.
 
           CMDSRC_MENU         Posted by a menu control. The usCmd parameter
                               is the identifier of the menu item.
 
           CMDSRC_PUSHBUTTON   Posted by a push-button control. The usCmd
                               parameter is the window identifier of the
                               push button.
 
           CMDSRC_OTHER        Other source. The usCmd parameter gives
                               further control-specific information defined
                               for each control type.
 
fPointer   High word of mp2. Indicates if the message was posted as a result
           of a pointing-device (mouse) operation. A value of TRUE indicates
           a pointing device was used; a value of FALSE indicates a keyboard
           operation.
 
Return Value
 
An application should return zero if it processes this message.
 
See Also
 
WM_CONTROL, WM_HELP, WM_MENUSELECT, WM_TRANSLATEACCEL