Export (0) Print
Expand All

IKnownFolderManager::GetFolderByName method

Gets an object that represents a known folder identified by its canonical name. 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 GetFolderByName(
  [in]   LPCWSTR pszCanonicalName,
  [out]  IKnownFolder **ppkf
);

Parameters

pszCanonicalName [in]

Type: LPCWSTR

A pointer to the non-localized, canonical name for the known folder, stored as a null-terminated Unicode string. If this folder is a common or per-user folder, this value is also used as the value name of the "User Shell Folders" registry settings. This value is retrieved through the pszName member of the folder's KNOWNFOLDER_DEFINITION structure.

ppkf [out]

Type: IKnownFolder**

When this method returns, contains the address of a pointer to the IKnownFolder object that represents the known folder.

Return value

Type: HRESULT

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

Remarks

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

See also

IKnownFolderManager
Known Folders Sample

 

 

Community Additions

ADD
Show:
© 2014 Microsoft