Shell Functions


SHGetSpecialFolderLocation Function

Retrieves a pointer to the ITEMIDLIST structure of a special folder.

Syntax

HRESULT SHGetSpecialFolderLocation(      
    HWND hwndOwner,     int nFolder,     PIDLIST_ABSOLUTE *ppidl );

Parameters

hwndOwner
[in] Reserved.
nFolder
[in] A CSIDL value that identifies the folder of interest.
ppidl
[out] A pointer to an item identifier list (PIDL) specifying the folder's location relative to the root of the namespace (the desktop). It is the responsibility of the calling application to free the returned IDList by using CoTaskMemFree.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

With Microsoft Windows 2000, this function is superseded by SHGetFolderLocation.

Function Information

Minimum DLL Versionshell32.dll version 4.0 or later
Custom ImplementationNo
Headershlobj.h
Import libraryshell32.lib
Minimum operating systems Windows NT 4.0, Windows 95

See Also

SHGetSpecialFolderPath
Page view tracker