Jump to content

WM COMMAND: Difference between revisions

From EDM2
Created page with "This message occurs when a control has a significant event to notify to its owner, or when a key stroke has been translated by an accelerator table. ;in Menu Controls :The me..."
 
No edit summary
Line 42: Line 42:
;in Button Controls
;in Button Controls
: The default dialog procedure responds to this message by dismissing the dialog and passing uscmd (the control item identifier) as of the WinProcessDlg or the WinDlgBox function that initiated the dialog. It sets ulReserved to 0.  
: The default dialog procedure responds to this message by dismissing the dialog and passing uscmd (the control item identifier) as of the WinProcessDlg or the WinDlgBox function that initiated the dialog. It sets ulReserved to 0.  
;In Default Dialogs
:The default dialog procedure responds to this message by dismissing the dialog and passing uscmd (the control item identifier) as of the WinProcessDlg or the WinDlgBox function that initiated the dialog. It sets ulReserved to 0.


;in Menu Controls
;in Menu Controls

Revision as of 20:06, 14 May 2024

This message occurs when a control has a significant event to notify to its owner, or when a key stroke has been translated by an accelerator table.

in Menu Controls
The menu control window procedure sets uscmd to the menu-item identity.

Syntax

param1
    USHORT  uscmd       /* Command value. */
param2
    USHORT  ussource    /* Source type. */
    USHORT  uspointer   /* Pointer-device indicator. */

Parameters

uscmd (USHORT)
Command value.
It is the responsibility of the application to be able to relate uscmd to an application function.
ussource (USHORT)
Source type.
Identifies the type of control:
CMDSRC_PUSHBUTTON - Posted by a push-button control. uscmd is the window identity of the push button.
CMDSRC_MENU - Posted by a menu control. uscmd is the identity of the menu item.
CMDSRC_ACCELERATOR - Posted as the result of an accelerator. uscmd is the accelerator command value.
CMDSRC_FONTDLG - Font dialog. uscmd is the identity of the font dialog.
CMDSRC_FILEDLG - File dialog. uscmd is the identity of the file dialog.
CMDSRC_OTHER - Other source. uscmd gives further control-specific information defined for each control type.
uspointer (USHORT)
Pointer-device indicator.
TRUE - The message is posted as a result of a pointer-device operation.
FALSE - The message is posted as a result of a keyboard operation.

Returns

ulReserved (ULONG)
Reserved value, should be 0.

Remarks

This message is posted to the queue of the owner of the control.

WM_Command handles popup menu command identifiers for pickup, putdown and cancel drag operations. It determines which items to display based on the state of the lazy drag and droppability of the lazy drag set.

in Menu Controls

The menu control window procedure generates this message if the WM_MENUSELECT (in Menu Controls) message returns a rc of TRUE. when an item is selected that does not have the style of MIS_SYSCOMMAND or MIS_HELP. The menu control window procedure posts the message to the queue of the window owner.

Default Processing

The default window procedure takes no action on this message, other than to set ulReserved to 0.

in Button Controls
The default dialog procedure responds to this message by dismissing the dialog and passing uscmd (the control item identifier) as of the WinProcessDlg or the WinDlgBox function that initiated the dialog. It sets ulReserved to 0.
In Default Dialogs
The default dialog procedure responds to this message by dismissing the dialog and passing uscmd (the control item identifier) as of the WinProcessDlg or the WinDlgBox function that initiated the dialog. It sets ulReserved to 0.
in Menu Controls
The default window procedure takes no action on this message, other than to set ulReserved to 0.

Related Messages

  • WM_COMMAND (Default Dialogs)
  • WM_COMMAND (in Button Controls)
  • WM_COMMAND (in Menu Controls)
  • WM_SYSCOMMAND (in Title Bar Controls)