Delphi WinAPI SHGetSpecialFolderLocation 获取特殊文件夹位置(特殊目录路径)PIDLIST_ABSOLUTE

Delphi WinAPI SHGetSpecialFolderLocation 获取特殊文件夹位置(特殊目录路径)

描述:检索指向特殊文件夹的ITEMIDLIST结构的指针。SHGetSpecialFolderLocation将来可能会不受支持,更改或不可用。而使用 SHGetFolderLocation。

原型:

HRESULT SHGetSpecialFolderLocation(
  HWND             hwnd,
  int              csidl,
  PIDLIST_ABSOLUTE *ppidl
);

参数:

  • HWND  //父窗口句柄
  • int    //文件夹的CSIDL值。
  • PIDLIST_ABSOLUTE    //指定文件夹相对于名称空间根(桌面)的位置的 PIDL 值。调用应用程序负责使用 CoTaskMemFree 释放返回的IDList。

CSIDL(constant special item ID list)值提供了一种独特的独立于系统的方法来标识应用程序经常使用的特殊文件夹,但这些文件夹在任何给定的系统上可能没有相同的名称或位置。例如,系统文件夹在一个系统上可能是“C:Windows”,在另一个系统上可能是“C:Winnt”。这些常量在Shlobj.h中定义。

Constant/value

Description

CSIDL_ADMINTOOLS

Version 5.0. The file system directory that is used to store administrative tools for an individual user. The MMC will save customized consoles to this directory, and it will roam with the user.

FOLDERID_AdminTools

CSIDL_ALTSTARTUP

The file system directory that corresponds to the user's nonlocalized Startup program group. This value is recognized in Windows Vista for backward compatibility, but the folder itself no longer exists.

FOLDERID_Startup

CSIDL_APPDATA

Version 4.71. The file system directory that serves as a common repository for application-specific data. A typical path is C:Documents and SettingsusernameApplication Data.

FOLDERID_RoamingAppData

CSIDL_BITBUCKET

The virtual folder that contains the objects in the user's Recycle Bin.

FOLDERID_RecycleBinFolder

CSIDL_CDBURN_AREA

Version 6.0. The file system directory that acts as a staging area for files waiting to be written to a CD. A typical path is C:Documents and SettingsusernameLocal SettingsApplication DataMicrosoftCD Burning.

FOLDERID_CDBurning

CSIDL_COMMON_ADMINTOOLS

Version 5.0. The file system directory that contains administrative tools for all users of the computer.

FOLDERID_CommonAdminTools

CSIDL_COMMON_ALTSTARTUP

The file system directory that corresponds to the nonlocalized Startup program group for all users. This value is recognized in Windows Vista for backward compatibility, but the folder itself no longer exists.

FOLDERID_CommonStartup

CSIDL_COMMON_APPDATA

Version 5.0. The file system directory that contains application data for all users. A typical path is C:Documents and SettingsAll UsersApplication Data. This folder is used for application data that is not user specific. For example, an application can store a spell-check dictionary, a database of clip art, or a log file in the CSIDL_COMMON_APPDATA folder. This information will not roam and is available to anyone using the computer.

FOLDERID_ProgramData

CSIDL_COMMON_DESKTOPDIRECTORY

The file system directory that contains files and folders that appear on the desktop for all users. A typical path is C:Documents and SettingsAll UsersDesktop.

FOLDERID_PublicDesktop

CSIDL_COMMON_DOCUMENTS

The file system directory that contains documents that are common to all users. A typical path is C:Documents and SettingsAll UsersDocuments.

FOLDERID_PublicDocuments

CSIDL_COMMON_FAVORITES

The file system directory that serves as a common repository for favorite items common to all users.

FOLDERID_Favorites

CSIDL_COMMON_MUSIC

Version 6.0. The file system directory that serves as a repository for music files common to all users. A typical path is C:Documents and SettingsAll UsersDocumentsMy Music.

FOLDERID_PublicMusic

CSIDL_COMMON_OEM_LINKS

This value is recognized in Windows Vista for backward compatibility, but the folder itself is no longer used.

FOLDERID_CommonOEMLinks

CSIDL_COMMON_PICTURES

Version 6.0. The file system directory that serves as a repository for image files common to all users. A typical path is C:Documents and SettingsAll UsersDocumentsMy Pictures.

FOLDERID_PublicPictures

CSIDL_COMMON_PROGRAMS

The file system directory that contains the directories for the common program groups that appear on the Start menu for all users. A typical path is C:Documents and SettingsAll UsersStart MenuPrograms.

FOLDERID_CommonPrograms

CSIDL_COMMON_STARTMENU

The file system directory that contains the programs and folders that appear on the Start menu for all users. A typical path is C:Documents and SettingsAll UsersStart Menu.

FOLDERID_CommonStartMenu

CSIDL_COMMON_STARTUP

The file system directory that contains the programs that appear in the Startup folder for all users. A typical path is C:Documents and SettingsAll UsersStart MenuProgramsStartup.

FOLDERID_CommonStartup

CSIDL_COMMON_TEMPLATES

The file system directory that contains the templates that are available to all users. A typical path is C:Documents and SettingsAll UsersTemplates.

FOLDERID_CommonTemplates

CSIDL_COMMON_VIDEO

Version 6.0. The file system directory that serves as a repository for video files common to all users. A typical path is C:Documents and SettingsAll UsersDocumentsMy Videos.

FOLDERID_PublicVideos

CSIDL_COMPUTERSNEARME

The folder that represents other computers in your workgroup.

FOLDERID_NetworkFolder

CSIDL_CONNECTIONS

The virtual folder that represents Network Connections, that contains network and dial-up connections.

FOLDERID_ConnectionsFolder

CSIDL_CONTROLS

The virtual folder that contains icons for the Control Panel applications.

FOLDERID_ControlPanelFolder

CSIDL_COOKIES

The file system directory that serves as a common repository for Internet cookies. A typical path is C:Documents and SettingsusernameCookies.

FOLDERID_Cookies

CSIDL_DESKTOP

The virtual folder that represents the Windows desktop, the root of the namespace.

FOLDERID_Desktop

CSIDL_DESKTOPDIRECTORY

The file system directory used to physically store file objects on the desktop (not to be confused with the desktop folder itself). A typical path is C:Documents and SettingsusernameDesktop.

FOLDERID_Desktop

CSIDL_DRIVES

The virtual folder that represents My Computer, containing everything on the local computer: storage devices, printers, and Control Panel. The folder can also contain mapped network drives.

FOLDERID_ComputerFolder

CSIDL_FAVORITES

The file system directory that serves as a common repository for the user's favorite items. A typical path is C:Documents and SettingsusernameFavorites.

FOLDERID_Favorites

CSIDL_FONTS

A virtual folder that contains fonts. A typical path is C:WindowsFonts.

FOLDERID_Fonts

CSIDL_HISTORY

The file system directory that serves as a common repository for Internet history items.

FOLDERID_History

CSIDL_INTERNET

A virtual folder for Internet Explorer.

FOLDERID_InternetFolder

CSIDL_INTERNET_CACHE

Version 4.72. The file system directory that serves as a common repository for temporary Internet files. A typical path is C:Documents and SettingsusernameLocal SettingsTemporary Internet Files.

FOLDERID_InternetCache

CSIDL_LOCAL_APPDATA

Version 5.0. The file system directory that serves as a data repository for local (nonroaming) applications. A typical path is C:Documents and SettingsusernameLocal SettingsApplication Data.

FOLDERID_LocalAppData

CSIDL_MYDOCUMENTS

Version 6.0. The virtual folder that represents the My Documents desktop item. This value is equivalent to CSIDL_PERSONAL.

FOLDERID_Documents

CSIDL_MYMUSIC

The file system directory that serves as a common repository for music files. A typical path is C:Documents and SettingsUserMy DocumentsMy Music.

FOLDERID_Music

CSIDL_MYPICTURES

Version 5.0. The file system directory that serves as a common repository for image files. A typical path is C:Documents and SettingsusernameMy DocumentsMy Pictures.

FOLDERID_Pictures

CSIDL_MYVIDEO

Version 6.0. The file system directory that serves as a common repository for video files. A typical path is C:Documents and SettingsusernameMy DocumentsMy Videos.

FOLDERID_Videos

CSIDL_NETHOOD

A file system directory that contains the link objects that may exist in the My Network Places virtual folder. It is not the same as CSIDL_NETWORK, which represents the network namespace root. A typical path is C:Documents and SettingsusernameNetHood.

FOLDERID_NetHood

CSIDL_NETWORK

A virtual folder that represents Network Neighborhood, the root of the network namespace hierarchy.

FOLDERID_NetworkFolder

CSIDL_PERSONAL

Version 6.0. The virtual folder that represents the My Documents desktop item. This is equivalent to CSIDL_MYDOCUMENTS.

FOLDERID_Documents

Previous to Version 6.0. The file system directory used to physically store a user's common repository of documents. A typical path is C:Documents and SettingsusernameMy Documents. This should be distinguished from the virtual My Documents folder in the namespace. To access that virtual folder, use SHGetFolderLocation, which returns the ITEMIDLIST for the virtual location, or refer to the technique described in Managing the File System.

CSIDL_PRINTERS

The virtual folder that contains installed printers.

FOLDERID_PrintersFolder

CSIDL_PRINTHOOD

The file system directory that contains the link objects that can exist in the Printers virtual folder. A typical path is C:Documents and SettingsusernamePrintHood.

FOLDERID_PrintHood

CSIDL_PROFILE

Version 5.0. The user's profile folder. A typical path is C:Usersusername. Applications should not create files or folders at this level; they should put their data under the locations referred to by CSIDL_APPDATA or CSIDL_LOCAL_APPDATA. However, if you are creating a new Known Folder the profile root referred to by CSIDL_PROFILE is appropriate.

FOLDERID_Profile

CSIDL_PROGRAM_FILES

Version 5.0. The Program Files folder. A typical path is C:Program Files.

FOLDERID_ProgramFiles

CSIDL_PROGRAM_FILESX86

 

FOLDERID_ProgramFilesX86

CSIDL_PROGRAM_FILES_COMMON

Version 5.0. A folder for components that are shared across applications. A typical path is C:Program FilesCommon. Valid only for Windows XP.

FOLDERID_ProgramFilesCommon

CSIDL_PROGRAM_FILES_COMMONX86

 

FOLDERID_ProgramFilesCommonX86

CSIDL_PROGRAMS

The file system directory that contains the user's program groups (which are themselves file system directories). A typical path is C:Documents and SettingsusernameStart MenuPrograms.

FOLDERID_Programs

CSIDL_RECENT

The file system directory that contains shortcuts to the user's most recently used documents. A typical path is C:Documents and SettingsusernameMy Recent Documents. To create a shortcut in this folder, use SHAddToRecentDocs. In addition to creating the shortcut, this function updates the Shell's list of recent documents and adds the shortcut to the My Recent Documents submenu of the Start menu.

FOLDERID_Recent

CSIDL_RESOURCES

Windows Vista. The file system directory that contains resource data. A typical path is C:WindowsResources.

FOLDERID_ResourceDir

CSIDL_RESOURCES_LOCALIZED

 

FOLDERID_LocalizedResourcesDir

CSIDL_SENDTO

The file system directory that contains Send To menu items. A typical path is C:Documents and SettingsusernameSendTo.

FOLDERID_SendTo

CSIDL_STARTMENU

The file system directory that contains Start menu items. A typical path is C:Documents and SettingsusernameStart Menu.

FOLDERID_StartMenu

CSIDL_STARTUP

The file system directory that corresponds to the user's Startup program group. The system starts these programs whenever the associated user logs on. A typical path is C:Documents and SettingsusernameStart MenuProgramsStartup.

FOLDERID_Startup

CSIDL_SYSTEM

Version 5.0. The Windows System folder. A typical path is C:WindowsSystem32.

FOLDERID_System

CSIDL_SYSTEMX86

 

FOLDERID_SystemX86

CSIDL_TEMPLATES

The file system directory that serves as a common repository for document templates. A typical path is C:Documents and SettingsusernameTemplates.

FOLDERID_Templates

CSIDL_WINDOWS

Version 5.0. The Windows directory or SYSROOT. This corresponds to the %windir% or %SYSTEMROOT% environment variables. A typical path is C:Windows.

FOLDERID_Windows

Flags

 

CSIDL_FLAG_CREATE

Version 5.0. Combine with another CSIDL to force the creation of the associated folder if it does not exist.

KF_FLAG_CREATE

CSIDL_FLAG_DONT_UNEXPAND

Combine with another CSIDL constant to ensure the expansion of environment variables.

KF_FLAG_DONT_UNEXPAND

CSIDL_FLAG_DONT_VERIFY

Combine with another CSIDL constant, except for CSIDL_FLAG_CREATE, to return an unverified folder path with no attempt to create or initialize the folder.

KF_FLAG_DONT_VERIFY

CSIDL_FLAG_NO_ALIAS

Combine with another CSIDL constant to ensure the retrieval of the true system path for the folder, free of any aliased placeholders such as %USERPROFILE%, returned by SHGetFolderLocation. This flag has no effect on paths returned by SHGetFolderPath.

KF_FLAG_NO_ALIAS

CSIDL_FLAG_PER_USER_INIT

 

CSIDL_FLAG_MASK

A mask for any valid CSIDL flag value.

创建时间:2020.11.24  更新时间:

 

原文地址:https://www.cnblogs.com/guorongtao/p/14029330.html