网站首页  词典首页

请输入您要查询的函数:

 

术语 regsetkeyvalue
释义 RegSetKeyValue
语法:
C++
LONG WINAPI RegSetKeyValue(
__in HKEY hKey,
__in_opt LPCTSTR lpSubKey,
__in_opt LPCTSTR lpValueName,
__in DWORD dwType,
__in_opt LPCVOID lpData,
__in DWORD cbData
);
RegSetKeyValue功能
设置为在指定的注册表项和子项中指定的值数据。
参数
hKey [in]
句柄到打开注册表项。关键必须是开放的KEY_SET_VALUE访问权限。有关更多信息,请参见注册表关键的安全和访问权限。
这种处理是由RegCreateKeyEx的,RegCreateKeyTransacted,RegOpenKeyEx,或RegOpenKeyTransacted函数返回。它也可以是下列预定义项之一:
HKEY_CLASSES_ROOT
HKEY_CURRENT_CONFIG
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERSlpSubKey [中,可选]
一个关键的名称。这关键的必须是由hKey参数确定的主要子项。
lpValueName [中,可选]
该注册表值的数据进行更新的名称。
dwType [in]
类型的数据所指向lpData参数。对于可能的类型的列表,请参阅注册表值类型。
lpData [中,可选]
该数据被存储在指定的值的名称。
对于基于字符串的类型,如为REG_SZ,该字符串必须空终止。随着REG_MULTI_SZ数据类型,字符串必须终止两个空字符。
cbData [in]
的资料指出,大小由lpData参数,以字节为单位。如果数据类型是REG_SZ,REG_EXPAND_SZ的,或均为REG_MULTI_SZ,cbData必须包括终止空字符或字符大小。
返回值
如果函数成功,返回值是ERROR_SUCCESS。
如果函数失败,返回值是一个非零错误代码Winerror.h中定义。您可以使用带有FORMAT_MESSAGE_FROM_SYSTEM标记的FormatMessage函数获得错误的一般说明。
备注
要编译的应用程序使用此功能,定义_WIN32_WINNT为0x0600或更高版本。有关详细信息,请参阅使用Windows头。
要求:
client最低支持Vista
server最低支持 Windows Server 2008
HeaderWinreg.h(头文件:winuser.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode和ANSI namesRegSetKeyValueW(Unicode)和RegSetKeyValueA(ANSI)的
参见
RegDeleteKeyValue
登记职能
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==RegSetKeyValue Function
Sets the data for the specified value in the specified registry key and subkey.
Syntax
C++
LONG WINAPI RegSetKeyValue(
__in HKEY hKey,
__in_opt LPCTSTR lpSubKey,
__in_opt LPCTSTR lpValueName,
__in DWORD dwType,
__in_opt LPCVOID lpData,
__in DWORD cbData
);
Parameters
hKey [in]
A handle to an open registry key. The key must have been opened with the KEY_SET_VALUE access right. For more information, see Registry Key Security and Access Rights .
This handle is returned by the RegCreateKeyEx , RegCreateKeyTransacted , RegOpenKeyEx , or RegOpenKeyTransacted function. It can also be one of the following predefined keys :
HKEY_CLASSES_ROOT
HKEY_CURRENT_CONFIG
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERSlpSubKey [in, optional]
The name of a key. This key must be a subkey of the key identified by the hKey parameter.
lpValueName [in, optional]
The name of the registry value whose data is to be updated.
dwType [in]
The type of data pointed to by the lpData parameter. For a list of the possible types, see Registry Value Types .
lpData [in, optional]
The data to be stored with the specified value name.
For string-based types, such as REG_SZ, the string must be null-terminated. With the REG_MULTI_SZ data type, the string must be terminated with two null characters.
cbData [in]
The size of the information pointed to by the lpData parameter, in bytes. If the data is of type REG_SZ, REG_EXPAND_SZ, or REG_MULTI_SZ, cbData must include the size of the terminating null character or characters.
Return Value
If the function succeeds, the return value is ERROR_SUCCESS.
If the function fails, the return value is a nonzero error code defined in Winerror.h. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.
Remarks
To compile an application that uses this function, define _WIN32_WINNT as 0x0600 or later. For more information, see Using the Windows Headers .
Requirements
Minimum supported clientWindows Vista
Minimum supported serverWindows Server 2008
HeaderWinreg.h (include Windows.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode and ANSI namesRegSetKeyValueW (Unicode) and RegSetKeyValueA (ANSI)
See Also
RegDeleteKeyValue
Registry Functions
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms724921(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:24:35