Compartilhar via


IContextMenu::InvokeCommand

4/8/2010

The InvokeCommand method executes the context menu command when the user selects a menu item that was added with the IContextMenu::QueryContextMenu method.

Syntax

HRESULT InvokeCommand (
  LPCMINVOKECOMMANDINFO lpici
);

Parameters

  • lpici
    Reference to the command information structure CMINVOKECOMMANDINFO. This is a data structure used to store the command, along with information about the command, such as its working directory and any optional parameters. For a list of the structure's members, see the table below*.*

Return Value

InvokeCommand returns S_OK if the command was successfully invoked or an appropriate error message if it was not.

Remarks

When InvokeCommand is called by the user, lpVerb's LOWORD contains the menu item ID offset idCmdFirst. InvokeCommand can also be called programmatically. In this case, lpVerb specifies the canonical name of the command to be invoked, which is typically retrieved with the IContextMenu::GetCommandString method.

Requirements

Header shlobj.h
Windows Embedded CE Windows CE 3.0 and later
Windows Mobile Pocket PC 2000 and later

See Also

Reference

IContextMenu
CMINVOKECOMMANDINFO
IContextMenu::GetCommandString
IContextMenu::QueryContextMenu