网站首页  词典首页

请输入您要查询的函数:

 

术语 regenumkeyex
释义 RegEnumKeyEx
语法:
C++
LONG WINAPI RegEnumKeyEx(
__in HKEY hKey,
__in DWORD dwIndex,
__out LPTSTR lpName,
__inout LPDWORD lpcName,
__reserved LPDWORD lpReserved,
__inout LPTSTR lpClass,
__inout_opt LPDWORD lpcClass,
__out_opt PFILETIME lpftLastWriteTime
);
RegEnumKeyEx函数
枚举指定的打开注册表关键字的子项。函数检索有关一个子项每次被调用的实时信息。
参数
hKey [in]
句柄到打开注册表项。关键必须是开放的KEY_ENUMERATE_SUB_KEYS访问权限。有关更多信息,请参见注册表关键的安全和访问权限。
这种处理是由RegCreateKeyEx的,RegCreateKeyTransacted,RegOpenKeyEx,或RegOpenKeyTransacted函数返回。它也可以是下列预定义项之一:
HKEY_CLASSES_ROOT
HKEY_CURRENT_CONFIG
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_PERFORMANCE_DATA
HKEY_USERS
dwIndex [in]
子项的索引来检索。这个参数应该是零一次调用RegEnumKeyEx函数,然后对后续调用递增。
由于子项不下令,任何新的子项将有一个任意的索引。这意味着,该函数可能会返回任何顺序子项。
lpName [out]
阿一个缓冲区,它接收子项的名称,包括终止空字符指针。该函数仅复制子项的名称,而不是全部的关键层次,到缓冲区。如果函数失败,没有任何资料复制到此缓冲区。
有关更多信息,请注册元素的大小限制。
lpcName [ in , out ]
一个变量,指定由lpName参数指定的缓冲区大小,以字符,指针。这一大小应包括终止空字符。如果函数成功,变量指向lpcName包含存储在缓冲区中的字符数,不包括终止空字符。
要确定所需的缓冲区大小,使用RegQueryInfoKey函数来确定由hKey参数确定的关键最大的子项的大小。
lpReserved
这个参数是保留,必须为NULL。
lpClass [ in , out ]
阿一个缓冲区,它接收用户定义的枚举子类的指针。此参数可以为NULL。
lpcClass [中,指出,可选]
一个变量,指定由lpClass参数指定的缓冲区大小,以字符,指针。大小应包括终止空字符。如果函数成功,lpcClass包含存储在缓冲区中的字符数不包括终止空字符。此参数可以为NULL只有lpClass为NULL。
lpftLastWriteTime [指出,可选]
阿指向FILETIME结构,它接收会上所列举的子项的最后写的时间。此参数可以为NULL。
返回值
如果函数成功,返回值是ERROR_SUCCESS。
如果函数失败,返回值是一个系统错误代码。如果没有更多的子项可用,该函数返回ERROR_NO_MORE_ITEMS。
如果lpName缓冲区太小得到关键的名称,该函数返回ERROR_MORE_DATA。
备注
枚举子项,应用程序应该首先调用设置为零的dwIndex参数RegEnumKeyEx功能。然后应用程序递增dwIndex参数并调用RegEnumKeyEx,直到没有更多的子项(即函数返回ERROR_NO_MORE_ITEMS)。
该应用程序还可以设置,直到与索引0子项dwIndex到在第一次调用该函数和自减指数最后子项指数为枚举。要检索的最后子项指数,使用RegQueryInfoKey功能。
当一个应用程序使用RegEnumKeyEx功能,但它不应作出任何登记职能,可能会改变,关键是列举的要求。
请注意,操作访问某些注册表项被重定向。有关更多信息,请在注册处注册,虚拟化和32位和64位应用程序数据。
实例
有关示例,请参见枚举注册表子项。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinreg.h(头文件:winuser.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode和ANSI namesRegEnumKeyExW(Unicode)和RegEnumKeyExA(ANSI)的
参见
FILETIME
RegCreateKeyEx的
RegDeleteKey
登记职能
注册表概述
RegOpenKeyEx
RegQueryInfoKey
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==RegEnumKeyEx Function
Enumerates the subkeys of the specified open registry key. The function retrieves information about one subkey each time it is called.
Syntax
C++
LONG WINAPI RegEnumKeyEx(
__in HKEY hKey,
__in DWORD dwIndex,
__out LPTSTR lpName,
__inout LPDWORD lpcName,
__reserved LPDWORD lpReserved,
__inout LPTSTR lpClass,
__inout_opt LPDWORD lpcClass,
__out_opt PFILETIME lpftLastWriteTime
);
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_PERFORMANCE_DATA
HKEY_USERS
dwIndex [in]
The index of the subkey to retrieve. This parameter should be zero for the first call to the RegEnumKeyEx 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. The function copies only the name of the subkey, not the full key hierarchy, to the buffer. If the function fails, no information is copied to this buffer.
For more information, see Registry Element Size Limits .
lpcName [in, out]
A pointer to a variable that specifies the size of the buffer specified by the lpName parameter, in characters. This size should include the terminating null character. If the function succeeds, the variable pointed to by lpcName contains the number of characters stored in the buffer, not including the terminating null character.
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.
lpReserved
This parameter is reserved and must be NULL.
lpClass [in, out]
A pointer to a buffer that receives the user-defined class of the enumerated subkey. This parameter can be NULL.
lpcClass [in, out, optional]
A pointer to a variable that specifies the size of the buffer specified by the lpClass parameter, in characters. The size should include the terminating null character. If the function succeeds, lpcClass contains the number of characters stored in the buffer, not including the terminating null character. This parameter can be NULL only if lpClass is NULL.
lpftLastWriteTime [out, optional]
A pointer to FILETIME structure that receives the time at which the enumerated subkey was last written. This parameter can be NULL.
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 RegEnumKeyEx function with the dwIndex parameter set to zero. The application should then increment the dwIndex parameter and call RegEnumKeyEx 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 subkey on the first call to the function and decrement the index until the subkey with the index 0 is enumerated. To retrieve the index of the last subkey, use the RegQueryInfoKey function.
While an application is using the RegEnumKeyEx function, it should not make calls to any registration functions that might change the key being enumerated.
Note that operations that access certain registry keys are redirected. For more information, see Registry Virtualization and 32-bit and 64-bit Application Data in the Registry .
Examples
For an example, see Enumerating Registry Subkeys .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinreg.h (include Windows.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode and ANSI namesRegEnumKeyExW (Unicode) and RegEnumKeyExA (ANSI)
See Also
FILETIME
RegCreateKeyEx
RegDeleteKey
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/ms724862(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:31:52