参数不对吧?
还可以用FormatMessage()输出错误信息.
还可以用FormatMessage()输出错误信息.
解决方案 »
- plugin 播放器插件在火狐上不能全屏
- 请问isdigit()函数为什么返回4??
- 请问AfxRepositionWindow() AFX_SIZEPARENTPARAMS 为什么提示 "找不到标识符"
- 在CListCtrl中的文字能否实现多种颜色?
- 如何得到qq互动空间中机器人(如小强)中发送消息的句柄
- snmp取值返回慢有什么办法解决
- 怎么解决???
- 热键在release下面发生错误,请帮忙。
- 请问在VC中可否加入纯C的文件,如果可以应该如何添加,为什么我添加完始终抱错
- 急需Leadtools 12.1 release 版本
- 如何通过source brower来查看mfc库源代码中的具体定义部分?我现在只能用看到声明部分,比如我输入CTime就只能看到它的定义部分(相当于.h文件),请问如何来看相当于.cpp的那部分?
- comboBox子类化:我这样写,为什么老出错?
RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", 0, KEY_ALL_ACCESS, &hKey)
我粘贴出来给你
RegOpenKeyEx
The RegOpenKeyEx function opens the specified key. LONG RegOpenKeyEx(
HKEY hKey, // handle to open key
LPCTSTR lpSubKey, // address of name of subkey to open
DWORD ulOptions, // reserved
REGSAM samDesired, // security access mask
PHKEY phkResult // address of handle to open key
);
Parameters
hKey
Handle to a currently open key or any of the following predefined reserved handle values:
HKEY_CLASSES_ROOT
HKEY_CURRENT_CONFIG
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
Windows NT: HKEY_PERFORMANCE_DATA
Windows 95 and Windows 98: HKEY_DYN_DATA lpSubKey
Pointer to a null-terminated string containing the name of the subkey to open. If this parameter is NULL or a pointer to an empty string, the function will open a new handle to the key identified by the hKey parameter. In this case, the function will not close the handles previously opened.
ulOptions
Reserved; must be zero.
samDesired
Specifies an access mask that describes the desired security access for the new key. This parameter can be a combination of the following values: Value Meaning
KEY_ALL_ACCESS Combination of KEY_QUERY_VALUE, KEY_ENUMERATE_SUB_KEYS, KEY_NOTIFY, KEY_CREATE_SUB_KEY, KEY_CREATE_LINK, and KEY_SET_VALUE access.
KEY_CREATE_LINK Permission to create a symbolic link.
KEY_CREATE_SUB_KEY Permission to create subkeys.
KEY_ENUMERATE_SUB_KEYS Permission to enumerate subkeys.
KEY_EXECUTE Permission for read access.
KEY_NOTIFY Permission for change notification.
KEY_QUERY_VALUE Permission to query subkey data.
KEY_READ Combination of KEY_QUERY_VALUE, KEY_ENUMERATE_SUB_KEYS, and KEY_NOTIFY access.
KEY_SET_VALUE Permission to set subkey data.
KEY_WRITE Combination of KEY_SET_VALUE and KEY_CREATE_SUB_KEY access.
phkResult
Pointer to a variable that receives a handle to the opened key. When you no longer need the returned handle, call the RegCloseKey function to close it.
Return Values
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.Res
Unlike the RegCreateKeyEx function, the RegOpenKeyEx function does not create the specified key if the key does not exist in the registry. QuickInfo
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Requires version 1.0 or later.
Header: Declared in winreg.h.
Import Library: Use advapi32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT.See Also
Registry Overview, Registry Functions, RegCloseKey, RegCreateKeyEx, RegDeleteKey, RegOpenKey