网站首页  词典首页

请输入您要查询的函数:

 

术语 regopenkey
释义 RegOpenKey
语法:
C++
LONG WINAPI RegOpenKey(
__in HKEY hKey,
__in_opt LPCTSTR lpSubKey,
__out PHKEY phkResult
);
RegOpenKey函数
打开指定的注册表项。
注意:此功能仅提供了兼容性与16位的Windows版本。应用程序应该使用RegOpenKeyEx函数。
参数
hKey [in]
句柄到打开注册表项。这种处理是由RegCreateKeyEx的或RegOpenKeyEx函数,返回的,也可以是下列预定义项之一:
HKEY_CLASSES_ROOT
HKEY_CURRENT_CONFIG
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
lpSubKey [中,可选]
该注册表项的名称被打开。这关键的必须是由hKey参数确定的主要子项。
键名不区分大小写。
如果此参数为NULL或为空字符串指针,函数返回相同的句柄通过英寸
有关更多信息,请注册元素的大小限制。
phkResult [out]
一个变量,它接收的句柄打开的关键指针。如果关键不是预定义的注册表项之一,调用RegCloseKey函数完成后,您使用的处理。
返回值
如果函数成功,返回值是ERROR_SUCCESS。
如果函数失败,返回值是一个非零错误代码Winerror.h中定义。您可以使用带有FORMAT_MESSAGE_FROM_SYSTEM标记的FormatMessage函数获得错误的一般说明。
备注
该RegOpenKey函数使用默认的安全访问掩码打开一个关键。如果开放的关键需要一个不同的访问权,函数失败,返回ERROR_ACCESS_DENIED。应用程序应该使用RegOpenKeyEx函数来指定在这种情况下访问掩码。
RegOpenKey不创建指定键,如果该键不存在于数据库中。
如果您的服务或应用程序模拟不同的用户,不要使用HKEY_CURRENT_USER此功能。相反,调用RegOpenCurrentUser功能。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinreg.h(头文件:winuser.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode和ANSI namesRegOpenKeyW(Unicode)和RegOpenKeyA(ANSI)的
参见
RegCloseKey
RegDeleteKey
登记职能
注册表概述
RegOpenKeyEx
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==RegOpenKey Function
Opens the specified registry key.
Note This function is provided only for compatibility with 16-bit versions of Windows. Applications should use the RegOpenKeyEx function.
Syntax
C++
LONG WINAPI RegOpenKey(
__in HKEY hKey,
__in_opt LPCTSTR lpSubKey,
__out PHKEY phkResult
);
Parameters
hKey [in]
A handle to an open registry key. 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, optional]
The name of the registry key to be opened. This key must be a subkey of the key identified by the hKey parameter.
Key names are not case sensitive.
If this parameter is NULL or a pointer to an empty string, the function returns the same handle that was passed in.
For more information, see Registry Element Size Limits .
phkResult [out]
A pointer to a variable that receives a handle to the opened key. If the key is not one of the predefined registry keys, call the RegCloseKey function after you have finished using the handle.
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 RegOpenKey function uses the default security access mask to open a key. If opening the key requires a different access right, the function fails, returning ERROR_ACCESS_DENIED. An application should use the RegOpenKeyEx function to specify an access mask in this situation.
RegOpenKey does not create the specified key if the key does not exist in the database.
If your service or application impersonates different users, do not use this function with HKEY_CURRENT_USER. Instead, call the RegOpenCurrentUser function.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinreg.h (include Windows.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode and ANSI namesRegOpenKeyW (Unicode) and RegOpenKeyA (ANSI)
See Also
RegCloseKey
RegDeleteKey
Registry Functions
Registry Overview
RegOpenKeyEx
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms724895(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:16:32