Export (0) Print
Expand All

IKnownFolderManager::GetFolder method

Gets an object that represents a known folder identified by its KNOWNFOLDERID. The object allows you to query certain folder properties, get the current path of the folder, redirect the folder to another location, and get the path of the folder as an ITEMIDLIST.

Syntax


HRESULT GetFolder(
  [in]   REFKNOWNFOLDERID rfid,
  [out]  IKnownFolder **ppkf
);

Parameters

rfid [in]

Type: REFKNOWNFOLDERID

Reference to the KNOWNFOLDERID.

ppkf [out]

Type: IKnownFolder**

When this method returns, contains an interface pointer to the IKnownFolder object that represents the folder.

Return value

Type: HRESULT

Returns S_OK if successful, or an error value otherwise, including the following:

Return codeDescription
E_INVALIDARG

Among other things, this value can indicate that the rfid parameter references a KNOWNFOLDERID that is not present on the system. Not all KNOWNFOLDERID values are present on all systems. Use IKnownFolderManager::GetFolderIds to retrieve the set of KNOWNFOLDERID values for the current system.

 

Remarks

To call this method, the caller must have at least User privileges.

When to Use

Use this method when you know exactly which known folder you are looking for and want to access it directly.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Shobjidl.h

IDL

Shobjidl.idl

DLL

Shell32.dll

See also

IKnownFolderManager
Known Folders Sample

 

 

Community Additions

ADD
Show:
© 2014 Microsoft