Export (0) Print
Expand All

SHGetSpecialFolderPath (Windows CE 5.0)

Windows CE 5.0
Send Feedback

This function retrieves the path of a special folder, identified by its CSIDL.

Syntax

BOOL SHGetSpecialFolderPath(
  HWND hwndOwner,
  LPTSTR lpszPath,
  int nFolder,
  BOOL fCreate 
);

Parameters

hwndOwner
[in] Handle to the owner window the client should specify if it displays a dialog box or message box.
lpszPath
[in] Address of a character buffer that receives the drive and path of the specified folder. This buffer must be at least MAX_PATH characters in size.
nFolder
[in] CSIDL that identifies the folder of interest. If a virtual folder is specified, this function fails. See SHGetSpecialFolderLocation Remarks for a list of valid CSIDL values.
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 Values

In the standard shell, this function returns TRUE if it is successful and FALSE if it fails.

If you are using the AYGShell extensions, then this function returns FALSE even if successful. If the folder represented by the CSIDL does not exist and is not created, a NULL string is returned indicating that the directory does not exist.

Note   For Windows Mobile 2003 and later, returns TRUE if successful, FALSE otherwise. For Pocket PC 2002 and Smartphone 2002 and earlier, returns FALSE even if successful. If the folder represented by the nFolder parameter does not exist and is not created, a NULL string is returned indicating that the directory does not exist.

Remarks

A number of folders are used frequently by applications, but may not have the same name or location on any given system. CSIDL values provide a unique system-independent way to identify these special folders. The values supersede the use of environment variables for this purpose. A CSIDL is used in conjunction with the shell function SHGetSpecialFolderLocation to retrieve a special folder's path name or item ID list (PIDL). See SHGetSpecialFolderLocation for a list of valid CSIDL values.

Windows Mobile Remarks

The following table lists valid CSIDL values for the nFolder parameter:

CSIDLValueDescription
CSIDL_APPDATA0x001AFile system directory that serves as a common repository for application-specific data.
CSIDL_DESKTOP0x0000Not supported on Smartphone.
CSIDL_DESKTOPDIRECTORY0x0010File system directory used to physically store file objects on the desktop (not to be confused with the desktop folder itself).
CSIDL_FAVORITES0x0006The file system directory that serves as a common repository for the user's favorite items.
CSIDL_FONTS0x0014The virtual folder that contains fonts.
CSIDL_MYMUSIC0x000dFolder that contains music files.
CSIDL_MYPICTURES0x0027Folder that contains picture files.
CSIDL_MYVIDEO 0x000eFolder that contains video files.
CSIDL_PERSONAL0x0005The file system directory that serves as a common repository for documents.
CSIDL_PROFILE0x0028Folder that contains the profile of the user.
CSIDL_PROGRAM_FILES0x0026The program files folder.
CSIDL_PROGRAMS0x0002The file system directory that contains the user's program groups, which are also file system directories.
CSIDL_RECENT0x0008File system directory that contains the user's most recently used documents.
CSIDL_STARTUP0x0007The file system directory that corresponds to the user's Startup program group. The system starts these programs when a device is powered on.
CSIDL_WINDOWS0x0024The Windows folder.

The CSIDL_DESKTOP value is invalid for the Smartphone platform. Smartphone uses a home screen instead of a desktop; do not use this CSIDL value within the Smartphone development environment.

Requirements

Pocket PC: Pocket PC 2000 and later
Smartphone: Smartphone 2002 and later
OS Versions: Windows CE 3.0 and later
Header: shellapi.h
Library: coredll.lib


Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.


Show:
© 2014 Microsoft