Expand Minimize

CDefFolderMenu_Create2 function

Creates a context menu for a selected group of file folder objects.

Syntax


HRESULT CDefFolderMenu_Create2(
  _In_opt_  PCIDLIST_ABSOLUTE pidlFolder,
  _In_opt_  HWND hwnd,
  UINT cidl,
  _In_opt_  PCUITEMID_CHILD_ARRAY *apidl,
  _In_opt_  IShellFolder *psf,
  _In_opt_  LPFNDFMCALLBACK lpfn,
  UINT nKeys,
  _In_opt_  const HKEY *ahkeys,
  _Out_     IContextMenu **ppcm
);

Parameters

pidlFolder [in, optional]

Type: PCIDLIST_ABSOLUTE

An ITEMIDLIST structure for the parent folder. This value can be NULL.

hwnd [in, optional]

Type: HWND

A handle to the parent window. This value can be NULL.

cidl

Type: UINT

The number of ITEMIDLIST structures in the array pointed to by apidl.

apidl [in, optional]

Type: PCUITEMID_CHILD_ARRAY*

A pointer to an array of ITEMIDLIST structures, one for each item that is selected.

psf [in, optional]

Type: IShellFolder*

A pointer to the parent folder's IShellFolder interface. This IShellFolder must support the IDataObject interface. If it does not, CDefFolderMenu_Create2 fails and returns E_NOINTERFACE. This value can be NULL.

lpfn [in, optional]

Type: LPFNDFMCALLBACK

The LPFNDFMCALLBACK callback object. This value can be NULL if the callback object is not needed.

nKeys

Type: UINT

The number of registry keys in the array pointed to by ahkeys.

Note  The maximum number of registry keys is 16. Callers must enforce this limit as the API does not. Failing to do so can result in memory corruption.

ahkeys [in, optional]

Type: const HKEY*

A pointer to an array of registry keys that specify the context menu handlers used with the menu's entries. For more information on context menu handlers, see Creating Context Menu Handlers. This array can contain a maximum of 16 registry keys.

ppcm [out]

Type: IContextMenu**

The address of an IContextMenu interface pointer that, when this function returns successfully, points to the IContextMenu object that represents the context menu.

Return value

Type: HRESULT

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

Requirements

Minimum supported client

Windows 2000 Professional, Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Shlobj.h

Library

Shell32.lib

DLL

Shell32.dll (version 5.00 or later)

See also

SHCreateDefaultContextMenu

 

 

Community Additions

ADD
Show:
© 2014 Microsoft