please dont rip this site Prev Next

RegOpenKeyEx info  Overview  Group

The RegOpenKeyEx function opens the specified key.

LONG RegOpenKeyEx(

    HKEY hKey,

// handle of open key

    LPCTSTR lpSubKey,

// address of name of subkey to open

    DWORD ulOptions,

// reserved

    REGSAM samDesired,

// security access mask

    PHKEY phkResult 

// address of handle of open key

   );

Parameters

hKey
Identifies 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 only:
 HKEY_PERFORMANCE_DATA 
Windows 95 only: HKEY_DYN_DATA 

lpSubKey
Points 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 of 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
Points to a variable that receives the handle of the opened key.

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.

Remarks

Unlike the RegCreateKeyEx function, the RegOpenKeyEx function does not create the specified key if the key does not exist in the registry.

See Also

RegCloseKey, RegCreateKeyEx, RegDeleteKey, RegOpenKey

Jeffrey T Greenberg of BERG Software Says:

the order of the HKEY's is wrong here, it is not critical, but if you don't have the ordinals then it is a bit tougher to figure them out. the order and their ordinals (for XP) is:
HKEY_CLASSES_ROOT = &H80000000
HKEY_CURRENT_USER = &H80000001
HKEY_LOCAL_MACHINE = &H80000002
HKEY_USERS = &H80000003
HKEY_CURRENT_CONFIG = &H80000004

But without what was written above, I would not have gotten the info I needed as fast so I hope I'm not too critical.
+
file: /Techref/os/win/api/win32/func/src/f73_4.htm, 6KB, , updated: 2004/8/21 13:17, local time: 2024/12/27 20:26,
TOP NEW HELP FIND: 
18.188.104.76:LOG IN

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://sxlist.com/techref/os/win/api/win32/func/src/f73_4.htm"> RegOpenKeyEx</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 

Welcome to sxlist.com!


Site supported by
sales, advertizing,
& kind contributors
just like you!

Please don't rip/copy
(here's why

Copies of the site on CD
are available at minimal cost.
 

Welcome to sxlist.com!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .