Επεξεργασία

Κοινή χρήση μέσω


IShellLibrary::GetFolders method (shobjidl_core.h)

Gets the set of child folders that are contained in the library.

Syntax

HRESULT GetFolders(
  [in]  LIBRARYFOLDERFILTER lff,
  [in]  REFIID              riid,
  [out] void                **ppv
);

Parameters

[in] lff

Type: LIBRARYFOLDERFILTER

One of the following LIBRARYFOLDERFILTER values that determines the folders to get. These flags cannot be combined.

LFF_FORCEFILESYSTEM (1)

Get only file-system folders. File-system folders are folders that have the SFGAO_FILESYSTEM attribute set.

LFF_STORAGEITEMS (2)

Get all folders that can be bound to IStorage objects. These folders are folders that have the SFGAO_STORAGE or SFGAO_FILESYSTEM attribute set.

LFF_ALLITEMS (3)

Get all folders in the library.

[in] riid

Type: REFIID

A reference to the IID of the interface to get in ppv. This value is typically IID_IShellItemArray, but it can also be IID_IObjectCollection, IID_IObjectArray, or the IID of any other interface that is implemented by CShellItemArray.

[out] ppv

Type: void**

A pointer to the interface requested in riid. If this call fails, this value is NULL.

Return value

Type: HRESULT

This method can return one of these values.

Return code Description
S_OK
The call was successful and the specified folders were returned in ppv.
S_FALSE
The call was successful but not all specified folders were returned in ppv.
E_
This method can return other error values.

Remarks

This method gets an ordered list of folders. By default, this method only returns storage locations.

For best results, use the IID_PPV_ARGS macro, defined in Objbase.h, for the riid and ppv parameters. This macro provides the correct IID based on the interface pointed to by the value in ppv, which eliminates the possibility of a coding error.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header shobjidl_core.h (include Shobjidl.h)

See also

IObjectArray

IObjectCollection

IShellItemArray

IShellLibrary

IShellLibrary::AddFolder

IShellLibrary::LoadLibraryFromItem

IShellLibrary::LoadLibraryFromKnownFolder

LIBRARYFOLDERFILTER

Library Description Schema

SFGAO

SHAddFolderPathToLibrary

SHLoadLibraryFromItem

SHLoadLibraryFromKnownFolder

SHLoadLibraryFromParsingName

SHRemoveFolderPathFromLibrary

Windows Libraries