IContextMenu

The IContextMenu interface is called by the shell to either create or merge a context menu associated with a shell object.

When to Implement

Implement IContextMenu in the following situations:

For a detailed discussion of how to implement IContextMenu, see Creating Context Menu Handlers.

When to Use

Applications use IContextMenu to get information about the items in an object's context menu and to invoke the associated commands. To get an object's IContextMenu interface, an application must call the object's IShellFolder::GetUIObjectOf method.

Methods

GetCommandString Retrieves a command's language-independent name or its Help text. The language-independent name is also referred to as a verb.
InvokeCommand Carries out the command associated with a context menu item.
QueryContextMenu Adds commands to a context menu.

Remarks

Shell extension handlers that export this interface must also export IShellExtInit. For details, see Creating Shell Extension Handlers.

Requirements

  Version 4.00 and later of Shell32.dll

  Windows NT/2000: Requires Windows NT 4.0 or later.
  Windows 95/98: Requires Windows 95 or later.
  Header: Declared in shlobj.h.