Expand Minimize

SHGetSpecialFolderPath function

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

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.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

End of client support

Windows 2000 Professional

End of server support

Windows 2000 Server

Header

Shlobj.h

Library

Shell32.lib

DLL

Shell32.dll (version 4.71 or later)

Unicode and ANSI names

SHGetSpecialFolderPathW (Unicode) and SHGetSpecialFolderPathA (ANSI)

 

 

Community Additions

ADD
Show:
© 2014 Microsoft