IKnownFolderManager::GetFolderIds method

Gets an array of all registered known folder IDs. This can be used in enumerating all known folders.

Syntax

HRESULT GetFolderIds(
  KNOWNFOLDERID **ppKFId,
  UINT          *pCount
);

Parameters

ppKFId

Type: KNOWNFOLDERID**

When this method returns, contains a pointer to an array of all KNOWNFOLDERID values registered with the system. Use CoTaskMemFree to free these resources when they are no longer needed.

pCount

Type: UINT*

When this method returns, contains a pointer to the number of KNOWNFOLDERID values in the array at ppKFId. The [in] functionality of this parameter is not used.

Return Value

Type: HRESULT

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

Remarks

The caller of this method must have User privileges.

You can use StringFromCLSID or StringFromGUID2 to convert the retrieved KNOWNFOLDERID values to strings.

Requirements

   
Windows version Windows Vista [desktop apps only] Windows Server 2008 [desktop apps only]
Target Platform Windows
Header shobjidl_core.h (include Shobjidl.h)

See Also

IKnownFolderManager

Known Folders Sample