网站首页  词典首页

请输入您要查询的函数:

 

术语 regsetvalue
释义 RegSetValue
语法:
C++
LONG WINAPI RegSetValue(
__in HKEY hKey,
__in_opt LPCTSTR lpSubKey,
__in DWORD dwType,
__in_opt LPCTSTR lpData,
__in DWORD cbData
);
RegSetValue函数
设置为默认或指定的注册表项未命名的值数据。这些数据必须是一个文本字符串。
注意:此功能仅提供了兼容性与16位的Windows版本。应用程序应该使用RegSetValueEx函数。
参数
hKey [in]
句柄到打开注册表项。关键必须是开放的KEY_SET_VALUE访问权限。有关更多信息,请参见注册表关键的安全和访问权限。
这种处理是由RegCreateKeyEx的,RegCreateKeyTransacted,RegOpenKeyEx,或RegOpenKeyTransacted函数返回。它也可以是下列预定义项之一:
HKEY_CLASSES_ROOT
HKEY_CURRENT_CONFIG
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
lpSubKey [中,可选]
在一个hKey参数子项的名称。该函数设置指定的子项的默认值。
键名不区分大小写。
如果此参数为NULL或为空字符串点,该函数设置由hKey确定的重要的默认值。
有关更多信息,请注册元素的大小限制。
dwType [in]
该类型的信息被储存。此参数必须是REG_SZ类型。为了存储其他数据类型,使用RegSetValueEx函数。
lpData [中,可选]
对数据进行存储。
cbData [in]
字符串的大小指向的lpData参数,不包括终止空字符,以字节为单位。
返回值
如果函数成功,返回值是ERROR_SUCCESS。
如果函数失败,返回值是一个非零错误代码Winerror.h中定义。您可以使用带有FORMAT_MESSAGE_FROM_SYSTEM标记的FormatMessage函数获得错误的一般说明。
备注
如果被lpSubKey参数指定不存在的键,RegSetValue函数创建它。
如果此函数的ANSI版本的使用,也可以通过显式调用RegSetValueA或不明确之前,包括WINDOWS.H文件的UNICODE),(lpData参数是必须的ANSI字符串。该字符串转换为Unicode之前,存储在注册表中。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinreg.h(头文件:winuser.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode和ANSI namesRegSetValueW(Unicode)和RegSetValueA(ANSI)的
参见
RegCreateKeyEx的
RegFlushKey
登记职能
注册表概述
RegOpenKeyEx
RegQueryValueEx
RegSetValueEx
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==RegSetValue Function
Sets the data for the default or unnamed value of a specified registry key. The data must be a text string.
Note This function is provided only for compatibility with 16-bit versions of Windows. Applications should use the RegSetValueEx function.
Syntax
C++
LONG WINAPI RegSetValue(
__in HKEY hKey,
__in_opt LPCTSTR lpSubKey,
__in DWORD dwType,
__in_opt LPCTSTR 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_USERS
lpSubKey [in, optional]
The name of a subkey of the hKey parameter. The function sets the default value of the specified subkey.
Key names are not case sensitive.
If this parameter is NULL or points to an empty string, the function sets the default value of the key identified by hKey.
For more information, see Registry Element Size Limits .
dwType [in]
The type of information to be stored. This parameter must be the REG_SZ type. To store other data types, use the RegSetValueEx function.
lpData [in, optional]
The data to be stored.
cbData [in]
The size of the string pointed to by the lpData parameter, not including the terminating null character, in bytes.
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
If the key specified by the lpSubKey parameter does not exist, the RegSetValue function creates it.
If the ANSI version of this function is used (either by explicitly calling RegSetValueA or by not defining UNICODE before including the Windows.h file), the lpData parameter must be an ANSI character string. The string is converted to Unicode before it is stored in the registry.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinreg.h (include Windows.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode and ANSI namesRegSetValueW (Unicode) and RegSetValueA (ANSI)
See Also
RegCreateKeyEx
RegFlushKey
Registry Functions
Registry Overview
RegOpenKeyEx
RegQueryValueEx
RegSetValueEx
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms724922(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:55