Export (0) Print
Expand All
Expand Minimize

SHCreateDefaultContextMenu function

Creates an object that represents the Shell's default context menu implementation.

Syntax


HRESULT SHCreateDefaultContextMenu(
  _In_   const DEFCONTEXTMENU *pdcm,
  REFIID riid,
  _Out_  void **ppv
);

Parameters

pdcm [in]

Type: const DEFCONTEXTMENU*

A pointer to a constant DEFCONTEXTMENU structure.

riid

Type: REFIID

Reference to the interface ID of the interface on which to base the object. This is typically the IID of IContextMenu, IContextMenu2, or IContextMenu3.

ppv [out]

Type: void**

When this method returns, contains the interface pointer requested in riid.

Return value

Type: HRESULT

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

This function is typically used in the implementation of IShellFolder::GetUIObjectOf. GetUIObjectOf creates a context menu that merges IContextMenu handlers specified by the DEFCONTEXTMENU structure, and can optionally provide default context menu verb implementations such as open, explore, delete, and copy.

The operation of this function is controlled by the input specified in the DEFCONTEXTMENU structure.The APICDefFolderMenu_Create2 is another way to construct the default context menu implementation. It is less expressive than SHCreateDefaultContextMenu but it exists in platforms prior to Windows Vista.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Shlobj.h

DLL

Shell32.dll (version 6.0.6000 or later)

 

 

Community Additions

ADD
Show:
© 2014 Microsoft