网站首页  词典首页

请输入您要查询的函数:

 

术语 regenumkey
释义 RegEnumKey
语法:
C++
LONG WINAPI RegEnumKey(
__in HKEY hKey,
__in DWORD dwIndex,
__out LPTSTR lpName,
__in DWORD cchName
);
RegEnumKey功能
枚举指定的打开注册表关键字的子项。该函数检索一个子项每次调用时的名称。
注意:此功能仅提供了兼容性与16位的Windows版本。应用程序应该使用RegEnumKeyEx功能。
参数
hKey [in]
句柄到打开注册表项。关键必须是开放的KEY_ENUMERATE_SUB_KEYS访问权限。有关更多信息,请参见注册表关键的安全和访问权限。
这种处理是由RegCreateKeyEx的,RegCreateKeyTransacted,RegOpenKeyEx,或RegOpenKeyTransacted函数返回。它也可以是下列预定义项之一:
HKEY_CLASSES_ROOT
HKEY_CURRENT_CONFIG
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
dwIndex [in]
该指数的子项hKey要检索。此值应为零的第一次调用RegEnumKey功能,然后再递增的后续调用。
由于子项不下令,任何新的子项将有一个任意的索引。这意味着,该函数可能会返回任何顺序子项。
lpName [out]
阿一个缓冲区,它接收子项的名称,包括终止空字符指针。此功能仅复制子项的名称,而不是全部的关键层次,到缓冲区。
有关更多信息,请注册元素的大小限制。
cchName [in]
缓冲区的大小指向的lpName参数,在TCHARs。 To determine the required buffer size, use the RegQueryInfoKey function to determine the size of the largest subkey for the key identified by the hKey parameter.
返回值
如果函数成功,返回值是ERROR_SUCCESS。
如果函数失败,返回值是一个系统错误代码。如果没有更多的子项可用,该函数返回ERROR_NO_MORE_ITEMS。
如果lpName缓冲区太小得到关键的名称,该函数返回ERROR_MORE_DATA。
备注
枚举子项,应用程序应该首先调用设置为零的dwIndex参数RegEnumKey功能。然后应用程序递增dwIndex参数并调用RegEnumKey函数,直到没有更多的子项(即函数返回ERROR_NO_MORE_ITEMS)。
该应用程序还可以设置,直到与索引0子项dwIndex的关于第一次调用的功能和递减指数最后一个关键指标枚举。要检索的最后子项指数,使用RegQueryInfoKey。
当一个应用程序使用RegEnumKey功能,但它不应作出任何登记职能,可能会改变的关键要求受到质疑。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinreg.h(头文件:winuser.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode和ANSI namesRegEnumKeyW(Unicode)和RegEnumKeyA(ANSI)的
参见
RegCloseKey
RegCreateKeyEx的
RegDeleteKey
RegEnumKeyEx
登记职能
注册表概述
RegOpenKeyEx
RegQueryInfoKey
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==RegEnumKey Function
Enumerates the subkeys of the specified open registry key. The function retrieves the name of one subkey each time it is called.
Note This function is provided only for compatibility with 16-bit versions of Windows. Applications should use the RegEnumKeyEx function.
Syntax
C++
LONG WINAPI RegEnumKey(
__in HKEY hKey,
__in DWORD dwIndex,
__out LPTSTR lpName,
__in DWORD cchName
);
Parameters
hKey [in]
A handle to an open registry key. The key must have been opened with the KEY_ENUMERATE_SUB_KEYS 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
dwIndex [in]
The index of the subkey of hKey to be retrieved. This value should be zero for the first call to the RegEnumKey function and then incremented for subsequent calls.
Because subkeys are not ordered, any new subkey will have an arbitrary index. This means that the function may return subkeys in any order.
lpName [out]
A pointer to a buffer that receives the name of the subkey, including the terminating null character. This function copies only the name of the subkey, not the full key hierarchy, to the buffer.
For more information, see Registry Element Size Limits .
cchName [in]
The size of the buffer pointed to by the lpName parameter, in TCHARs. To determine the required buffer size, use the RegQueryInfoKey function to determine the size of the largest subkey for the key identified by the hKey parameter.
Return Value
If the function succeeds, the return value is ERROR_SUCCESS.
If the function fails, the return value is a system error code . If there are no more subkeys available, the function returns ERROR_NO_MORE_ITEMS.
If the lpName buffer is too small to receive the name of the key, the function returns ERROR_MORE_DATA.
Remarks
To enumerate subkeys, an application should initially call the RegEnumKey function with the dwIndex parameter set to zero. The application should then increment the dwIndex parameter and call the RegEnumKey function until there are no more subkeys (meaning the function returns ERROR_NO_MORE_ITEMS).
The application can also set dwIndex to the index of the last key on the first call to the function and decrement the index until the subkey with index 0 is enumerated. To retrieve the index of the last subkey, use the RegQueryInfoKey .
While an application is using the RegEnumKey function, it should not make calls to any registration functions that might change the key being queried.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinreg.h (include Windows.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode and ANSI namesRegEnumKeyW (Unicode) and RegEnumKeyA (ANSI)
See Also
RegCloseKey
RegCreateKeyEx
RegDeleteKey
RegEnumKeyEx
Registry Functions
Registry Overview
RegOpenKeyEx
RegQueryInfoKey
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms724861(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 11:29:27