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.
© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View