网站首页  词典首页

请输入您要查询的函数:

 

术语 regreplacekey
释义 RegReplaceKey
语法:
C++
LONG WINAPI RegReplaceKey(
__in HKEY hKey,
__in_opt LPCTSTR lpSubKey,
__in LPCTSTR lpNewFile,
__in LPCTSTR lpOldFile
);
RegReplaceKey功能
替换文件备份注册表项及其所有子项的另一个文件,这样当下次系统启动,关键和子项的值将在新文件中。
参数
hKey [in]
句柄到打开注册表项。这种处理是由RegCreateKeyEx的或RegOpenKeyEx函数,返回的,也可以是下列预定义项之一:
HKEY_CLASSES_ROOT
HKEY_CURRENT_CONFIG
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
lpSubKey [中,可选]
该注册表项的子项和值要更换名称。如果该键存在,它必须是一个由hKey参数确定的主要子项。如果该子项不存在,则创建。此参数可以为NULL。
如果指定的子项是不是一个单元根,RegReplaceKey穿越了树结构单元,直到它遇到了一个单元的根,那么替换的是,在数据内容的单元文件的内容由lpNewFile指定。
有关更多信息,请注册元素的大小限制。
lpNewFile [in]
此次与注册表的信息文件的名称。此文件通常是由使用的RegSaveKey功能。
lpOldFile [in]
该文件的接收注册表的信息的备份副本的名称被取代。
返回值
如果函数成功,返回值是ERROR_SUCCESS。
如果函数失败,返回值是一个非零错误代码Winerror.h中定义。您可以使用带有FORMAT_MESSAGE_FROM_SYSTEM标记的FormatMessage函数获得错误的一般说明。
备注
有两个不同的注册表配置单元文件格式。注册表配置单元创建当前的操作系统通常不能由早先的加载系统。
由lpNewFile参数指定的文件保持打开状态,直到系统重新启动。
If hKey is a handle returned by RegConnectRegistry , then the paths specified in lpNewFile and lpOldFile are relative to the remote computer.
调用进程必须在计算机上的注册表中,居住SE_RESTORE_NAME和SE_BACKUP_NAME特权。有关更多信息,请运行特权。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinreg.h(头文件:winuser.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode和ANSI namesRegReplaceKeyW(Unicode)和RegReplaceKeyA(ANSI)的
参见
RegConnectRegistry
RegDeleteKey
登记职能
注册表概述
RegLoadKey
RegRestoreKey
RegSaveKey
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==RegReplaceKey Function
Replaces the file backing a registry key and all its subkeys with another file, so that when the system is next started, the key and subkeys will have the values stored in the new file.
Syntax
C++
LONG WINAPI RegReplaceKey(
__in HKEY hKey,
__in_opt LPCTSTR lpSubKey,
__in LPCTSTR lpNewFile,
__in LPCTSTR lpOldFile
);
Parameters
hKey [in]
A handle to an open registry key. This handle is returned by the RegCreateKeyEx or RegOpenKeyEx function, or it can 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 the registry key whose subkeys and values are to be replaced. If the key exists, it must be a subkey of the key identified by the hKey parameter. If the subkey does not exist, it is created. This parameter can be NULL.
If the specified subkey is not the root of a hive, RegReplaceKey traverses up the hive tree structure until it encounters a hive root, then it replaces the contents of that hive with the contents of the data file specified by lpNewFile.
For more information, see Registry Element Size Limits .
lpNewFile [in]
The name of the file with the registry information. This file is typically created by using the RegSaveKey function.
lpOldFile [in]
The name of the file that receives a backup copy of the registry information being replaced.
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
There are two different registry hive file formats. Registry hives created on current operating systems typically cannot be loaded by earlier ones.
The file specified by the lpNewFile parameter remains open until the system is restarted.
If hKey is a handle returned by RegConnectRegistry , then the paths specified in lpNewFile and lpOldFile are relative to the remote computer.
The calling process must have the SE_RESTORE_NAME and SE_BACKUP_NAME privileges on the computer in which the registry resides. For more information, see Running with Special Privileges .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinreg.h (include Windows.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode and ANSI namesRegReplaceKeyW (Unicode) and RegReplaceKeyA (ANSI)
See Also
RegConnectRegistry
RegDeleteKey
Registry Functions
Registry Overview
RegLoadKey
RegRestoreKey
RegSaveKey
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms724913(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:25:56