网站首页  词典首页

请输入您要查询的函数:

 

术语 regdeletekey
释义 RegDeleteKey
语法:
C++
LONG WINAPI RegDeleteKey(
__in HKEY hKey,
__in LPCTSTR lpSubKey
);
RegDeleteKey函数
删除一个子项及其值。请注意,键名不区分大小写。
64位Windows:WOW64上,32位应用程序查看注册表树,它是从注册表树单独的64位应用程序视图。为了使应用程序能够删除注册表中的其他观点项,使用RegDeleteKeyEx功能。
参数
hKey [in]
句柄到打开注册表项。在这个关键不影响删除操作的访问权限。如需有关访问权限的信息,请参阅注册表关键的安全和访问权限。
这种处理是由RegCreateKeyEx的或RegOpenKeyEx函数,返回的,也可以是下列预定义项之一:
HKEY_CLASSES_ROOT
HKEY_CURRENT_CONFIG
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
lpSubKey [in]
键的名称被删除。它必须是一个关键的hKey标识子项,但它不能有子项。这个参数不能为NULL。
该函数打开与删除访问权的子项。
键名不区分大小写。
有关更多信息,请注册元素的大小限制。
返回值
如果函数成功,返回值是ERROR_SUCCESS。
如果函数失败,返回值是一个非零错误代码Winerror.h中定义。为了得到一个错误的一般性说明,您可以使用与FORMAT_MESSAGE_FROM_SYSTEM标记的FormatMessage函数。
备注
已删除的关键不是删除,直到最后一个句柄,它已关闭。
该子项删除不能有子项。要删除一个键及其所有子项,您需要枚举子项,并删除他们的个人。要删除键递归,使用RegDeleteTree或SHDeleteKey功能。
实例
举例说,使用此功能,请参阅删除的子项的一把钥匙。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinreg.h(头文件:winuser.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode和ANSI namesRegDeleteKeyW(Unicode)和RegDeleteKeyA(ANSI)的
参见
RegCloseKey
RegCreateKeyEx的
RegDeleteTree
登记职能
注册表概述
RegOpenKeyEx
SHDeleteEmptyKey
SHDeleteKey
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==RegDeleteKey Function
Deletes a subkey and its values. Note that key names are not case sensitive.
64-bit Windows: On WOW64, 32-bit applications view a registry tree that is separate from the registry tree that 64-bit applications view. To enable an application to delete an entry in the alternate registry view, use the RegDeleteKeyEx function.
Syntax
C++
LONG WINAPI RegDeleteKey(
__in HKEY hKey,
__in LPCTSTR lpSubKey
);
Parameters
hKey [in]
A handle to an open registry key. The access rights of this key do not affect the delete operation. For more information about access rights, see Registry Key Security and Access Rights .
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]
The name of the key to be deleted. It must be a subkey of the key that hKey identifies, but it cannot have subkeys. This parameter cannot be NULL.
The function opens the subkey with the DELETE access right.
Key names are not case sensitive.
For more information, see Registry Element Size Limits .
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. To get a generic description of the error, you can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag.
Remarks
A deleted key is not removed until the last handle to it is closed.
The subkey to be deleted must not have subkeys. To delete a key and all its subkeys, you need to enumerate the subkeys and delete them individually. To delete keys recursively, use the RegDeleteTree or SHDeleteKey function.
Examples
For an example that uses this function, 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
Unicode and ANSI namesRegDeleteKeyW (Unicode) and RegDeleteKeyA (ANSI)
See Also
RegCloseKey
RegCreateKeyEx
RegDeleteTree
Registry Functions
Registry Overview
RegOpenKeyEx
SHDeleteEmptyKey
SHDeleteKey
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms724845(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:08