Win32 SDK Registry Operation - REGCREATEKEY

zhaozj2021-02-08  186

RegcreateKey

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

The regcreateKey function creates a new reference button. If this button already exists in the registry, this function opens it. This function is compatible with Windows 3.1. Win32-based applications should use the RegcreateKeyex function.

Long regcreateKey

HKEY HKEY, / / ​​Handle to open the key

LPCTSTR LPSUBKEY, / / ​​Address to open the name of the subkey

Phkey phkResult // The address of the buffer of the handle is opened

);

parameter

HKEY

The handle of the current open button or the following has been determined to keep the handle value:

HKEY_CLASS_ROTHKEY_CURRENT_CONFIGHKEY_CURRENT_USERHKEY_LOCAL_MACHINEHKEY_USERSWINDOWS NT: HKEY_PERFORMANCE_DATA Windows 95 and Windows 98: HKEY_DYN_DATA

The sub-key of the key recognized by HKEY is open or newly created by RegcreateKey.

LPSUBKEY

Point to a string that contains empty characters over or the name to open or new. This key must be a subkey that can be identified by the HKEY parameter.

If HKEY is one of the confirmed kept values, LPSUBKEY can be NULL. In this case, the function phkResult returns the same handle as being passed.

PhkResult

Point variables that receive open or new built keys. When you no longer need to return your handle, call

RegcloseKey function close it

return value

Returns Error_Success if the call is successful.

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

note

An application can use the RegcreateKey function to create a new separate key at a time. For example, an application can create a four-level sub-key (including the three levels of the previous three levels of a given button) like a LPSUBKEY parameter string below:

Subkey1 / Subkey2 / Subkey3 / Subkey4

This key that can be identified by the HKEY parameter must be opened with key_create_sub_key access (key_write access permissions including key_create_ssub_key access).

If the lpsubkey parameter is an empty string address, the function opens and transmits the key that can be identified by the HKEY parameter.

Quick information

Windows NT: It takes 3.1 or higher. Windows: Need Windows 95 or higher. Windows CE: does not support. File Head: WinReg.h Input Library: Advapi32.lib. Unicode: Performed as Unicode and ANSI in Windows NT.

See

REGISTRY, Regclose, RegcreateKeyex, RegdleteKey, Regopenkey, Regopenkeyex, RegSetValue

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

New Post(0)