Creates a context menu for a selected group of file folder objects.
Syntax
HRESULT CDefFolderMenu_Create2(
PCIDLIST_ABSOLUTE pidlFolder,
HWND hwnd,
UINT cidl,
PCUITEMID_CHILD_ARRAY *apidl,
IShellFolder *psf,
LPFNDFMCALLBACK lpfn,
UINT nKeys,
const HKEY *ahkeys,
IContextMenu **ppcm
);
Parameters
- pidlFolder
-
[in] An ITEMIDLIST structure for the parent folder. This value can be NULL.
- hwnd
-
[in] A handle to the parent window. This value can be NULL.
- cidl
-
[in] The number of ITEMIDLIST structures in the array pointed to by apidl.
- apidl
-
[in] A pointer to an array of ITEMIDLIST structures, one for each item that is selected.
- psf
-
[in] 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] A pointer to a LPFNDFMCALLBACK callback function. This value can be NULL.
- nKeys
-
[in] 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] 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] When this function returns, contains an IContextMenu interface pointer for the context menu.
Return Value
Returns S_OK if successful, or an error value otherwise.
Function Information
| Minimum DLL Version | shell32.dll version 5.00 or later |
|---|
| Custom Implementation | No |
|---|
| Header | shlobj.h |
|---|
| Import library | shell32.lib |
|---|
| Minimum operating systems |
Windows 2000, Windows Millennium Edition |
|---|
See Also
SHCreateDefaultContextMenu