Share via


IContextMenu::InvokeCommand

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 Values

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

Pocket PC: Windows Mobile 2000 and later
OS Versions: Windows CE 3.0 and later
Header: Declared in shlobj.h

See Also

CMINVOKECOMMANDINFO

IContextMenu::GetCommandString

IContextMenu::QueryContextMenu

Send feedback on this topic to the authors.

© 2005 Microsoft Corporation. All rights reserved.