IContextMenu2::QueryContextMenuIContextMenu2::QueryContextMenu*
*Contents  *Index  *Topic Contents
*Previous Topic: IContextMenu2::InvokeCommand
*Next Topic: IContextMenu3

IContextMenu2::QueryContextMenu


HRESULT QueryContextMenu(
    HMENU hmenu,
    UINT indexMenu,
    UINT idCmdFirst,
    UINT idCmdLast,
    UINT uFlags
   );

Adds menu items to the specified menu. The menu items should be inserted at a specified position in the menu, and their menu item identifiers must be in a given range.

hmenu
Handle to the menu. The handler should specify this handle when adding menu items.
indexMenu
Zero-based position at which to insert the first menu item.
idCmdFirst
Minimum value that the handler can specify for a menu item identifier.
idCmdLast
Maximum value that the handler can specify for menu item identifiers.
uFlags
Optional flags specifying how the context menu can be changed. Can be any combination of the following values:
CMF_DEFAULTONLY The user activates the default action, typically by double-clicking. This value provides a hint for the context menu to add nothing if it does not modify the default item in the menu. A context menu extension or drag-and-drop handler should not add any menu items if this value is specified. A namespace extension should add only the default item (if any).
CMF_EXPLORE Context menu handlers should ignore this value. It is specified when the context menu is for an object in Windows Explorer.
CMF_NORMAL Indicates normal operation. A context menu extension, namespace extension, or drag-and-drop handler can add any menu items.
CMF_VERBSONLY Context menu handlers should ignore this value. This value is specified if the context menu is for a shortcut object.

The remaining bits of the low-order word are reserved by the system. The high-order word may be used for context-specific communications.

The actual identifier of each menu item should be idCmdFirst plus a menu identifier offset in the range zero through (idCmdLastidCmdFirst).

See also IContextMenu2, IContextMenu


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.