SHGetSpecialFolderLocation();怎么使用??SHGetSpecialFolderLocation();怎么使用??SHGetSpecialFolderLocation();怎么使用??
SHGetSpecialFolderLocation
This function retrieves the location of a special folder, such as My Handheld PC, Recycle Bin, Control Panel, Desktop, Printers, Fonts, or various file system directories.
WINSHELLAPI HRESULT WINAPI SHGetSpecialFolderLocation(
HWND hwndOwner,
int nFolder,
LPITEMIDLIST *ppidl );
Parameters
hwndOwner
[in] Handle to the owner window the client should specify if it displays a dialog box or message box.
nFolder
[in] Value specifying the folder for which to retrieve the location. It is one of the following values:
Value Description
CSIDL_BITBUCKET File system directory that contains file objects in the user's Recycle Bin. The location of this directory is not in the registry; it is marked with the hidden and system attributes to prevent the user from moving or deleting it.
CSIDL_CONTROLS Virtual folder containing icons for the Control Panel applications.
CSIDL_DESKTOP Windows Desktop, which is a virtual folder at the root of the namespace.
CSIDL_DESKTOPDIRECTORY File system directory used to physically store file objects on the desktop (not to be confused with the desktop folder itself).
CSIDL_DRIVES My Computer, which is a virtual folder that contains everything on the local computer: storage devices, printers, and Control Panel. The folder may also contain mapped network drives.
CSIDL_FAVORITES File system directory that serves as a common repository for the user's favorite items.
CSIDL_FONTS Virtual folder containing fonts.
CSIDL_NETHOOD File system directory containing objects that appear in the network neighborhood.
CSIDL_NETWORK Network Neighborhood Folder, which is a virtual folder that represents the top level of the network hierarchy.
CSIDL_PERSONAL File system directory that serves as a common repository for documents.
CSIDL_PRINTERS Virtual folder containing installed printers.
CSIDL_PROGRAMS File system directory that contains the user's program groups (which are also file system directories).
CSIDL_RECENT File system directory that contains the user's most recently used documents.
CSIDL_SENDTO File system directory that contains Send To menu items.
CSIDL_STARTMENU File system directory containing Start menu items.
CSIDL_STARTUP File system directory that corresponds to the user's Startup program group. The system starts these programs when a device is powered on.
CSIDL_TEMPLATES File system directory that serves as a common repository for document templates.
ppidl
[in] Pointer to a pointer to an item identifier list specifying the folder's location relative to the root of the namespace (the desktop). The calling application is responsible for freeing this pointer with the shell's IMalloc interface (see SHGetMalloc).
Return Values
NOERROR indicates success. An OLE-defined error result indicates failure.
Requirements
Runs on Versions Defined in Include Link to
Windows CE OS 1.0 and 2.12 Shlobj.h
Note This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.
Built on Thursday, November 16, 2000
--------------------------------------------------------------------------------
如何实现:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Edit1->Text=Favorites文件夹的具体路径;
}
//---------------------------------------------------------------------------