网站首页  词典首页

请输入您要查询的函数:

 

术语 regclosekey
释义 RegCloseKey
语法:
C++
LONG WINAPI RegCloseKey(
__in HKEY hKey
);
RegCloseKey函数
关闭句柄指定的注册表项。
参数
hKey [in]
一个句柄,开关键关闭。句柄必须受到RegCreateKeyEx的,RegCreateKeyTransacted,RegOpenKeyEx,RegOpenKeyTransacted,或RegConnectRegistry功能打开。
返回值
如果函数成功,返回值是ERROR_SUCCESS。
如果函数失败,返回值是一个非零错误代码Winerror.h中定义。您可以使用带有FORMAT_MESSAGE_FROM_SYSTEM标记的FormatMessage函数获得错误的一般说明。
备注
在处理指定的键不应该用后已关闭,因为这将不再有效。重点处理不应在打开任何超过必要的。
RegCloseKey函数不一定信息写入到注册表中,然后返回,它可以作为缓存几秒钟的时间来刷新到硬盘上。 ,如果应用程序必须明确写入注册表信息到硬盘上,它可以使用RegFlushKey功能。 RegFlushKey,但是,使用的系统资源,应该只在必要时调用。
实例
有关示例,请参阅删除的子项的一把钥匙。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinreg.h(头文件:winuser.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
参见
RegConnectRegistry
RegCreateKeyEx的
RegDeleteKey
RegFlushKey
登记职能
注册表概述
RegOpenKeyEx
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==RegCloseKey Function
Closes a handle to the specified registry key.
Syntax
C++
LONG WINAPI RegCloseKey(
__in HKEY hKey
);
Parameters
hKey [in]
A handle to the open key to be closed. The handle must have been opened by the RegCreateKeyEx , RegCreateKeyTransacted , RegOpenKeyEx , RegOpenKeyTransacted , or RegConnectRegistry function.
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 handle for a specified key should not be used after it has been closed, because it will no longer be valid. Key handles should not be left open any longer than necessary.
The RegCloseKey function does not necessarily write information to the registry before returning; it can take as much as several seconds for the cache to be flushed to the hard disk. If an application must explicitly write registry information to the hard disk, it can use the RegFlushKey function. RegFlushKey, however, uses many system resources and should be called only when necessary.
Examples
For an example, see Deleting a Key with Subkeys .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinreg.h (include Windows.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
See Also
RegConnectRegistry
RegCreateKeyEx
RegDeleteKey
RegFlushKey
Registry Functions
Registry Overview
RegOpenKeyEx
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms724837(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:15:30