SHGetSpecialFolderPath function
Retrieves the path of a special folder, identified by its CSIDL.
Syntax
BOOL SHGetSpecialFolderPath( HWND hwndOwner, __out LPTSTR lpszPath, __in int csidl, __in BOOL fCreate );
Parameters
- hwndOwner
-
Type: HWND
Reserved.
- lpszPath [out]
-
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.
- csidl [in]
-
Type: int
A CSIDL that identifies the folder of interest. If a virtual folder is specified, this function will fail.
- fCreate [in]
-
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.
With Windows 2000, this function is superseded by ShGetFolderPath. You can use this function on earlier systems by including the redistributable DLL, ShFolder.dll.
Requirements
|
Minimum supported client | Windows 2000 Professional, Windows XP |
|---|---|
|
Minimum supported server | Windows 2000 Server |
|
Header |
|
|
Library |
|
|
DLL |
|
|
Unicode and ANSI names | SHGetSpecialFolderPathW (Unicode) and SHGetSpecialFolderPathA (ANSI) |
Send comments about this topic to Microsoft
Build date: 9/7/2011
- 9/1/2011
- Jim Michaels
- 11/16/2011
- gilbert.mackay
- 3/12/2010
- Anthony_P
- 7/27/2011
- Samuel Bronson
