IShellMenu::SetShellFolder method (shobjidl_core.h)

Specifies the folder for the menu band to browse.

Syntax

HRESULT SetShellFolder(
  [in] IShellFolder      *psf,
  [in] PCIDLIST_ABSOLUTE pidlFolder,
  [in] HKEY              hKey,
  [in] DWORD             dwFlags
);

Parameters

[in] psf

Type: IShellFolder*

A pointer to the folder's IShellFolder interface. This pointer can be NULL.

[in] pidlFolder

Type: PCIDLIST_ABSOLUTE

The folder's fully qualified ITEMIDLIST. This value can be NULL.

[in] hKey

Type: HKEY

An HKEY with an "Order" value that is used to store the order of the menu. This value can be NULL.

[in] dwFlags

Type: DWORD

Flags that specify how the menu band operates.

SMSET_BOTTOM

Put this folder at the bottom of the menu.

SMSET_USEBKICONEXTRACTION

Use the background icon extractor.

SMSET_HASEXPANDABLEFOLDERS

This folder contains expandable folders.

SMSET_COLLAPSEONEMPTY

Collapse the menu if empty.

Return value

Type: HRESULT

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

Remarks

Call this method after you call IShellMenu::Initialize.

Requirements

Requirement Value
Minimum supported client Windows XP with SP2 [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header shobjidl_core.h (include Shobjidl.h)
DLL Shell32.dll