Click to Rate and Give Feedback
MSDN
MSDN Library
User Interface
Windows Shell
Shell Reference
Shell Functions
 SHGetSpecialFolderPath Function
SHGetSpecialFolderPath Function

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 Versionshell32.dll version 4.71 or later
Custom ImplementationNo
Headershlobj.h
Import libraryshell32.lib
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0
UnicodeImplemented as ANSI and Unicode versions.
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker