Retrieves the path of a special folder, identified by its CSIDL.
Syntax
BOOL SHGetSpecialFolderPath(
HWND hwndOwner,
LPTSTR lpszPath,
int csidl,
BOOL fCreate
);
Parameters
- hwndOwner
-
Reserved.
- lpszPath
-
[out] 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.
- csidl
-
[in] A CSIDL that identifies the folder of interest. If a virtual folder is specified, this function will fail.
- fCreate
-
[in] 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
TRUE if successful; otherwise, FALSE.
Remarks
The Microsoft Internet Explorer 4.0 Desktop Update must be installed for this function to be available.
With Microsoft Windows 2000, this function is superseded by ShGetFolderPath. You can use this function on earlier systems by including the redistributable DLL, ShFolder.dll.
Function Information
| Minimum DLL Version | shell32.dll version 4.71 or later |
|---|
| Custom Implementation | No |
|---|
| Header | shlobj.h |
|---|
| Import library | shell32.lib |
|---|
| Minimum operating systems |
Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0 |
|---|
| Unicode | Implemented as
ANSI and Unicode versions. |
|---|