网站首页  词典首页

请输入您要查询的函数:

 

术语 regoverridepredefkey
释义 RegOverridePredefKey
语法:
C++
LONG WINAPI RegOverridePredefKey(
__in HKEY hKey,
__in_opt HKEY hNewHKey
);
RegOverridePredefKey功能
地图预定义的注册表项指定的注册表项。
参数
hKey [in]
一个句柄,下列预定义项之一:
HKEY_CLASSES_ROOT
HKEY_CURRENT_CONFIG
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_PERFORMANCE_DATA
HKEY_USERS
hNewHKey [中,可选]
句柄到打开注册表项。这种处理是由RegCreateKeyEx的或RegOpenKeyEx函数返回。它不能预定义的关键之一。函数映射hKey提及hNewHKey的关键。这只会影响调用进程。
如果hNewHKey为NULL,则功能恢复了预定义项的默认映射。
返回值
如果函数成功,返回值是ERROR_SUCCESS。
如果函数失败,返回值是一个非零错误代码Winerror.h中定义。您可以使用带有FORMAT_MESSAGE_FROM_SYSTEM标记的FormatMessage函数获得错误的一般说明。
备注
该RegOverridePredefKey功能是用于软件的安装程序。这使他们重新映射1预定义项,加载DLL组件,将在系统上安装,调用的DLL入口点,并检查对注册表进行更改该组件企图利用。安装程序可以写那些打算由DLL,或使在写入到数据的更改的位置变化。
例如,考虑一个安装程序,安装一个应用程序作为安装的一部分ActiveX控件。安装程序需要调用该控件的的DllRegisterServer进入点,使控制进行自我注册。在此之前调用,安装程序可以调用RegOverridePredefKey重新映射HKEY_CLASSES_ROOT到一个临时的关键,例如为HKEY_CURRENT_USER \\ TemporaryInstall \\ DllRegistration。然后,它调用的DllRegisterServer,这将导致该ActiveX控件的注册表项写入到临时的关键。安装程序,然后调用RegOverridePredefKey再次恢复HKEY_CLASSES_ROOT的原始映射。安装程序可以修改写入临时密钥的密钥,如有必要,然后将它们复制到原来的HKEY_CLASSES_ROOT。
经过对RegOverridePredefKey电话,您可以安全地调用RegCloseKey关闭hNewHKey处理。该系统有自己的参考hNewHKey。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinreg.h(头文件:winuser.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
参见
中的DllRegisterServer
登记职能
注册表概述
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==RegOverridePredefKey Function
Maps a predefined registry key to the specified registry key.
Syntax
C++
LONG WINAPI RegOverridePredefKey(
__in HKEY hKey,
__in_opt HKEY hNewHKey
);
Parameters
hKey [in]
A handle to one of the following predefined keys :
HKEY_CLASSES_ROOT
HKEY_CURRENT_CONFIG
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_PERFORMANCE_DATA
HKEY_USERS
hNewHKey [in, optional]
A handle to an open registry key. This handle is returned by the RegCreateKeyEx or RegOpenKeyEx function. It cannot be one of the predefined keys. The function maps hKey to refer to the hNewHKey key. This affects only the calling process.
If hNewHKey is NULL, the function restores the default mapping of the predefined key.
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
The RegOverridePredefKey function is intended for software installation programs. It allows them to remap a predefined key, load a DLL component that will be installed on the system, call an entry point in the DLL, and examine the changes to the registry that the component attempted to make. The installation program can then write those changes to the locations intended by the DLL, or make changes to the data before writing it.
For example, consider an installation program that installs an ActiveX control as part of an application installation. The installation program needs to call the control's DllRegisterServer entry point to enable the control to register itself. Before this call, the installation program can call RegOverridePredefKey to remap HKEY_CLASSES_ROOT to a temporary key such as HKEY_CURRENT_USER\\TemporaryInstall\\DllRegistration. It then calls DllRegisterServer, which causes the ActiveX control to write its registry entries to the temporary key. The installation program then calls RegOverridePredefKey again to restore the original mapping of HKEY_CLASSES_ROOT. The installation program can modify the keys written to the temporary key, if necessary, before copying them to the original HKEY_CLASSES_ROOT.
After the call to RegOverridePredefKey, you can safely call RegCloseKey to close the hNewHKey handle. The system maintains its own reference to hNewHKey.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinreg.h (include Windows.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
See Also
DllRegisterServer
Registry Functions
Registry Overview
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms724901(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:23:36