Win32 SDK Registry Operation - REGOPENKEYEX

zhaozj2021-02-08  200

RegopenKeyex

(For more information, http://websl.126.com)

The RegopenKeyEx function opens a specified key.

Long regopenkeyex

HKEY HKEY, / / ​​Open the handle of the primary key

LPCTSTR LPSUBKEY, / / ​​Open the address name of the subkey

DWORD Uloptions, // Reserved

Regsam samdesired, // secure access mask

Phkey phkResult // To open the address of the key handle

);

parameter

HKEY

The handle is a currently open key or the following already determined reserved handle value:

HKEY_CLASS_ROTHKEY_CURRENT_CONFIGHKEY_CURRENT_USERHKEY_LOCAL_MACHINEHKEY_USERSWINDOWS NT: HKEY_PERFORMANCE_DATA Windows 95 and Windows 98: HKEY_DYN_DATA

LPSUBKEY

Point to a name to open the subkey (the string ends with empty characters). If this parameter is empty or pointing to an empty string, the function will open a

The handle of the new key identified by the HKEY parameter. In this syntax, the function will not turn off the previously opened handle.

Uloptions

Reserved; must be zero.

Samdesired

Specify a secure access mask for the new key. This parameter can be combined by the following values:

The value of key_all_access is equivalent to Key_Query_Value, key_enumerate_sub_keys, key_notify, key_create_sub_key, key_create_link, key_set_value. Key_create_link allows new symbolic connections. Key_create_sub_key allows new subsidiary. Key_enumerate_sub_keys Allows the list. Key_Execute allows read operations. Key_Notify allows modifications. Key_Query_Value Allows query sub-key data. Key_Read is equivalent to Key_Query_Value, key_enumerate_sub_keys, key_notify combination Key_SET_VALUE allows the sub-key data Key_Write equivalent to the combination of key_set_value and key_create_sub_Key.

PhkResult

Specify a variable to receive the handle of the opened button. When you are not too long to return to the handle, call

The Regclosekey function is turned off.

return value

Returns Error_Success if the function succeeds.

If the function call fails, a non-zero error code is returned (defined in the Winerror.h file). You can use the FormatMessage function with the format_message_from_system tag to get an error.

note

Unlike the RegcreateKeyEx function, if the key specified in the registry does not exist that the regoPENKEYEX function will not create a new specified key.

Quick information

Windows NT: It takes 3.1 or higher. Windows: Need Windows 95 or higher. Windows CE: 1.0 or higher. Header file: WinReg.h. Enter the library: Advapi32.lib. Unicode: Windows NT version is performed as Unicode and ANSI.

See

Registry Overview, Registry Functions, RegCloseKey, RegcreateKeyex, RegdeleteKey, Regopenkey

转载请注明原文地址:https://www.9cbs.com/read-3382.html

New Post(0)