网站首页  词典首页

请输入您要查询的函数:

 

术语 shsetknownfolderpath
释义 SHSetKnownFolderPath
语法:
HRESULT SHSetKnownFolderPath( REFKNOWNFOLDERID rfid,
DWORD dwFlags,
HANDLE hToken,
PCWSTR pszPath
);
SHSetKnownFolderPath功能
一个已知的文件夹重定向到一个新位置。
参数
RFID技术
[in]一个GUID标识已知的文件夹。
dwFlags
[in]为0或下面的值。
KF_FLAG_DONT_UNEXPAND
如果设置此标志,由pszPath引用的路径部分可以由环境字符串诸如%USERPROFILE%。
hToken
[in]一个访问令牌用来表示一个特定的用户。此参数通常设置为NULL,在这种情况下,函数试图访问当前用户的文件夹的实例。但是,您可能需要指定一个值hToken对这些文件夹可以有多个用户,但属于单个用户处理。这一类型的最常用的文件夹中的文件。
调用应用程序负责时hToken正确模拟非空。它必须有特定的用户,包括TOKEN_QUERY和TOKEN_IMPERSONATE适当的安全权限,以及用户的注册表配置单元当前必须安装。见的访问控制问题的进一步讨论访问控制。
分配的hToken参数值为-1表示默认用户。这允许SHSetKnownFolderPath客户设置文件夹位置(如桌面文件夹)的默认用户。默认用户的用户配置文件复制时,任何新创建的用户帐户,并包括诸如文件和桌面特殊文件夹。任何项目添加到Default User文件夹也会出现在任何新的用户帐户。请注意,默认用户的文件夹访问需要管理员权限。
pszPath
[in]一个指向该文件夹的新路径。这是一个空终止长度MAX_PATH Unicode字符串。此路径不能是零长度。
返回值
返回S_OK如果成功,或者一个错误值,否则,其中包括以下内容:
E_INVALIDARGAmong其他外,这项值可以显示,RFID技术参数引用KNOWNFOLDERID未在系统中存在。并非所有KNOWNFOLDERID值是目前所有系统上。使用IKnownFolderManager::GetFolderIds来获取当前系统的KNOWNFOLDERID值。
备注
这个函数替换SHSetFolderPath。较旧的功能现在只是一种SHSetKnownFolderPath包装。
这个函数的调用者必须具有管理员权限。呼吁市民都知道这个文件夹的功能,调用者必须具有管理员权限。对于每个用户的文件夹被调用只需要用户权限。
已知的一些文件夹,例如,文件夹,是每个用户。每个用户有一个自己的文档文件夹不同的道路。如果hToken为NULL,则尝试访问的API调用应用程序的文件夹,这是实例的当前用户。如果hToken是一个有效的用户令牌,空气污染指数试图模拟用户使用此凭证,并试图访问该用户的实例。
此函数不能要求类型的文件夹KF_CATEGORY_FIXED和KF_CATEGORY_VIRTUAL。
呼吁类型KF_CATEGORY_COMMON,调用该函数应用程序文件夹必须以提升的权限运行。
功能信息
最低DLL版本 shell32.dll版本6.0.6000或更高
自定义ImplementationNo
Headershlobj.h
import libraryNone
最低支持操作系统 Vista
参见
IKnownFolder::SetPath,IKnownFolderManager::重定向,SHGetKnownFolderPath,SHGetKnownFolderIDList,IKnownFolder::GetPath
==英文原文==SHSetKnownFolderPath Function
Redirects a known folder to a new location.
Syntax
HRESULT SHSetKnownFolderPath( REFKNOWNFOLDERID rfid,
DWORD dwFlags,
HANDLE hToken,
PCWSTR pszPath
);
Parameters
rfid
[in] A GUID that identifies the known folder.
dwFlags
[in] Either 0 or the following value.
KF_FLAG_DONT_UNEXPAND
If this flag is set, portions of the path referenced by pszPath may be represented by environment strings such as %USERPROFILE%.
hToken
[in] An access token used to represent a particular user. This parameter is usually set to NULL, in which case the function tries to access the current user's instance of the folder. However, you may need to assign a value to hToken for those folders that can have multiple users but are treated as belonging to a single user. The most commonly used folder of this type is Documents.
The calling application is responsible for correct impersonation when hToken is non-null. It must have appropriate security privileges for the particular user, including TOKEN_QUERY and TOKEN_IMPERSONATE, 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 SHSetKnownFolderPath to set 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.
pszPath
[in] A pointer to the folder's new path. This is a null-terminated Unicode string of length MAX_PATH. This path cannot be of zero length.
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 SHSetFolderPath . That older function is now simply a wrapper for SHSetKnownFolderPath.
The caller of this function must have Administrator privileges. To call this function on public known folders, the caller must have Administrator privileges. For per-user known folders the caller only requires User privileges.
Some of the known folders, for example, the Documents folder, are per-user. Every user has a different path for their Documents folder. If hToken is NULL, the API tries to access the calling application's instance of the folder, which is that of the current user. If hToken is a valid user token, the API tries to impersonate the user using this token and tries to access that user's instance.
This function cannot be called on folders of type KF_CATEGORY_FIXED and KF_CATEGORY_VIRTUAL .
To call this function on a folder of type KF_CATEGORY_COMMON , the calling application must be running with elevated privileges.
Function Information
Minimum DLL Versionshell32.dll version 6.0.6000 or later
Custom ImplementationNo
Headershlobj.h
Import libraryNone
Minimum operating systemsWindows Vista
See Also
IKnownFolder::SetPath , IKnownFolderManager::Redirect , SHGetKnownFolderPath , SHGetKnownFolderIDList , IKnownFolder::GetPath
==原始网址==http://msdn.microsoft.com/en-us/library/bb762249(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 11:32:02