网站首页  词典首页

请输入您要查询的函数:

 

术语 shgetknownfolderpath
释义 SHGetKnownFolderPath
语法:
HRESULT SHGetKnownFolderPath( REFKNOWNFOLDERID rfid,
DWORD dwFlags,
HANDLE hToken,
PWSTR *ppszPath
);
SHGetKnownFolderPath功能
检索的文件夹的KNOWNFOLDERID发现一个已知的文件夹的完整路径。
参数
RFID技术
[in]对KNOWNFOLDERID标识文件夹的引用。
dwFlags
[in]旗帜,指定专门检索选项。此值可以是0,否则,一个或KNOWN_FOLDER_FLAG价值观。
hToken
[in]一个访问令牌代表一个特定的用户。如果该参数为NULL,这是最常见的用法,功能要求为当前用户已知的文件夹。
请求通过该用户的hToken特定用户的文件夹。这通常是在一个服务,有足够的权限来检索特定的用户令牌中。该凭证必须开立TOKEN_QUERY和TOKEN_IMPERSONATE权利。除了通过用户的hToken,该特定用户注册表配置单元必须安装。见的访问控制问题的进一步讨论访问控制。
分配的hToken参数值为-1表示默认用户。这允许SHGetKnownFolderPath为客户找到文件夹位置(如桌面文件夹)的默认用户。默认用户的用户配置文件复制时,任何新创建的用户帐户,并包括诸如文件和桌面特殊文件夹。任何项目添加到Default User文件夹也会出现在任何新的用户帐户。请注意,默认用户的文件夹访问需要管理员权限。
ppszPath
[内]当此方法返回时,包含一个指针地址空结尾的Unicode字符串,指定已知文件夹的路径。调用进程负责释放该资源一旦不再需要通过调用CoTaskMemFree。
返回值
返回S_OK如果成功,或者一个错误值,否则,其中包括以下内容:
E_INVALIDARGAmong其他外,这项值可以显示,RFID技术参数引用KNOWNFOLDERID未在系统中存在。并非所有KNOWNFOLDERID值是目前所有系统上。使用IKnownFolderManager::GetFolderIds来获取当前系统的KNOWNFOLDERID值。
备注
这个函数替换的SHGetFolderPath。较旧的功能现在只是一种SHGetKnownFolderPath包装。
功能信息
最低DLL版本 shell32.dll版本6.0.6000或更高
自定义ImplementationNo
Headershlobj.h
import libraryNone
最低支持操作系统 Vista
参见
SHGetKnownFolderIDList,SHSetKnownFolderPath,IKnownFolder::GetPath
==英文原文==SHGetKnownFolderPath Function
Retrieves the full path of a known folder identified by the folder's KNOWNFOLDERID .
Syntax
HRESULT SHGetKnownFolderPath( REFKNOWNFOLDERID rfid,
DWORD dwFlags,
HANDLE hToken,
PWSTR *ppszPath
);
Parameters
rfid
[in] A reference to the KNOWNFOLDERID that identifies the folder.
dwFlags
[in] Flags that specify special retrieval options. This value can be 0; otherwise, one or more of the KNOWN_FOLDER_FLAG values.
hToken
[in] An access token that represents a particular user. If this parameter is NULL, which is the most common usage, the function requests the known folder for the current user.
Request a specific user's folder by passing the hToken of that user. This is typically done in the context of a service that has sufficient privileges to retrieve the token of a given user. That token must be opened with TOKEN_QUERY and TOKEN_IMPERSONATE rights. In addition to passing the user's hToken, the registry hive of that specific user must be 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 SHGetKnownFolderPath 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 Documents and Desktop. Any items added to the Default User folder also appear in any new user account. Note that access to the Default User folders requires administrator privileges.
ppszPath
[out] When this method returns, contains the address of a pointer to a null-terminated Unicode string that specifies the path of the known folder. The calling process is responsible for freeing this resource once it is no longer needed by calling CoTaskMemFree .
Return Value
Returns S_OK if successful, or an error value otherwise, including the following:
E_INVALIDARGAmong other things, this value can indicate that the rfid parameter references a KNOWNFOLDERID that is not present on the system. Not all KNOWNFOLDERID values are present on all systems. Use IKnownFolderManager::GetFolderIds to retrieve the set of KNOWNFOLDERID values for the current system.
Remarks
This function replaces SHGetFolderPath . That older function is now simply a wrapper for SHGetKnownFolderPath.
Function Information
Minimum DLL Versionshell32.dll version 6.0.6000 or later
Custom ImplementationNo
Headershlobj.h
Import libraryNone
Minimum operating systemsWindows Vista
See Also
SHGetKnownFolderIDList , SHSetKnownFolderPath , IKnownFolder::GetPath
==原始网址==http://msdn.microsoft.com/en-us/library/bb762188(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:48