网站首页  词典首页

请输入您要查询的函数:

 

术语 shgetfolderlocation
释义 SHGetFolderLocation
语法:
HRESULT SHGetFolderLocation( HWND hwndOwner,
int nFolder,
HANDLE hToken,
DWORD dwReserved,
PIDLIST_ABSOLUTE *ppidl
);
SHGetFolderLocation功能
已过时。检索路径作为一个ITEMIDLIST结构的文件夹。
参数
hwndOwner
[in]保留。
nFolder
[in]阿CSIDL值标识文件夹位于。与CSIDLs相关的文件夹可能不存在于特定的系统。
hToken
[in]一个访问令牌可以用来表示一个特定的用户。它通常设置为NULL,但可以在有需要为那些属于单个用户文件夹处理多个用户。这一类型的最常用的文件夹是我的文档。调用应用程序负责正确模拟时hToken是非空。它必须有特定的用户适当的安全权限,以及用户的注册表配置单元当前必须安装。见的访问控制问题的进一步讨论访问控制。
分配的hToken参数值为-1表示默认用户。这允许SHGetFolderLocation为客户找到文件夹位置(如桌面文件夹)的默认用户。默认用户的用户配置文件复制时,任何新创建的用户帐户,并包括我的文档等特殊文件夹和桌面。任何项目添加到Default User文件夹也会出现在任何新的用户帐户。
dwReserved
[in]保留。必须设置为0。
ppidl
[指出]指针的地址的项目标识符列表结构,指定文件夹的位置相对于命名空间(桌面)的根。该ppidl参数设置为NULL的失败。调用应用程序负责释放调用ILFree这种资源。
返回值
返回S_OK如果成功,或者一个错误值,否则,其中包括以下内容:
ERROR_FILE_NOT_FOUNDThe在nFolder的CSIDL有效,但该文件夹不存在。
E_INVALIDARGThe在nFolder的CSIDL是无效的。
备注
注意:由于Windows Vista中,这项功能只不过是SHGetKnownFolderIDList包装。该CSIDL值被转换到其关联KNOWNFOLDERID和SHGetKnownFolderIDList被调用。新的应用程序应该使用已知的文件夹系统,而不是旧的CSIDL系统,该系统只支持向后兼容。
该SHGetFolderLocation,了SHGetFolderPath,SHGetSpecialFolderLocation和SHGetSpecialFolderPath职能是首选的方法来获取对系统处理的文件夹早于Windows Vista的。 ExpandEnvironmentStrings功能,如使用环境变量名直接的形式%VariableName%,可能并不可靠。
此函数是一个SHGetSpecialFolderLocation超集,与壳牌的早期版本中。
功能信息
最低DLL版本 shell32.dll 5.0或更新版本
自定义ImplementationNo
Headershlobj.h
import libraryshell32.lib
最低经营systemsWindows 2000年,Windows Millennium Edition中
参见
IKnownFolder::GetIDList
==英文原文==SHGetFolderLocation Function
Deprecated. Retrieves the path of a folder as an ITEMIDLIST structure.
Syntax
HRESULT SHGetFolderLocation( HWND hwndOwner,
int nFolder,
HANDLE hToken,
DWORD dwReserved,
PIDLIST_ABSOLUTE *ppidl
);
Parameters
hwndOwner
[in] Reserved.
nFolder
[in] A CSIDL value that identifies the folder to be located. The folders associated with the CSIDLs might not exist on a particular system.
hToken
[in] An access token that can be used to represent a particular user. It is usually set to NULL, but it may be needed when there are multiple users for those folders that are treated as belonging to a single user. The most commonly used folder of this type is My Documents. The calling application is responsible for correct impersonation when hToken is non-NULL. It must have appropriate security privileges for the particular user, and the user's registry hive must be currently mounted. See Access Control for further discussion of access control issues.
Assigning the hToken parameter a value of -1 indicates the Default User. This allows clients of SHGetFolderLocation to find folder locations (such as the Desktop folder) for the Default User. The Default User user profile is duplicated when any new user account is created, and includes special folders such as My Documents and Desktop. Any items added to the Default User folder also appear in any new user account.
dwReserved
[in] Reserved. Must be set to 0.
ppidl
[out] The address of a pointer to an item identifier list structure that specifies the folder's location relative to the root of the namespace (the desktop). The ppidl parameter is set to NULL on failure. The calling application is responsible for freeing this resource by calling ILFree .
Return Value
Returns S_OK if successful, or an error value otherwise, including the following:
ERROR_FILE_NOT_FOUNDThe CSIDL in nFolder is valid but the folder does not exist.
E_INVALIDARGThe CSIDL in nFolder is not valid.
Remarks
Note As of Windows Vista, this function is merely a wrapper for SHGetKnownFolderIDList . The CSIDL value is translated to its associated KNOWNFOLDERID and SHGetKnownFolderIDList is called. New applications should use the known folder system rather than the older CSIDL system, which is supported only for backward compatibility.
The SHGetFolderLocation, SHGetFolderPath , SHGetSpecialFolderLocation , and SHGetSpecialFolderPath functions are the preferred ways to obtain handles to folders on systems earlier than Windows Vista. Functions such as ExpandEnvironmentStrings that use the environment variable names directly, in the form %VariableName%, may not be reliable.
This function is a superset of SHGetSpecialFolderLocation, included with earlier versions of the Shell.
Function Information
Minimum DLL Versionshell32.dll version 5.0 or later
Custom ImplementationNo
Headershlobj.h
Import libraryshell32.lib
Minimum operating systemsWindows 2000, Windows Millennium Edition
See Also
IKnownFolder::GetIDList
==原始网址==http://msdn.microsoft.com/en-us/library/bb762180(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:20:17