SHGetSpecialFolderPathA function (shlobj_core.h)

[SHGetSpecialFolderPath is not supported. Instead, use SHGetFolderPath.]

Retrieves the path of a special folder, identified by its CSIDL.

Syntax

BOOL SHGetSpecialFolderPathA(
        HWND  hwnd,
  [out] LPSTR pszPath,
  [in]  int   csidl,
  [in]  BOOL  fCreate
);

Parameters

hwnd

Type: HWND

Reserved.

[out] pszPath

Type: LPTSTR

A pointer to a null-terminated string that receives the drive and path of the specified folder. This buffer must be at least MAX_PATH characters in size.

[in] csidl

Type: int

A CSIDL that identifies the folder of interest. If a virtual folder is specified, this function will fail.

[in] fCreate

Type: BOOL

Indicates whether the folder should be created if it does not already exist. If this value is nonzero, the folder is created. If this value is zero, the folder is not created.

Return value

Type: BOOL

TRUE if successful; otherwise, FALSE.

Remarks

The Microsoft Internet Explorer 4.0 Desktop Update must be installed for this function to be available.

Note

The shlobj_core.h header defines SHGetSpecialFolderPath as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header shlobj_core.h (include Shlobj.h, Shlobj_core.h)
Library Shell32.lib
DLL Shell32.dll (version 4.71 or later)