API function for registry operation (regcreatekeyex: This function is used to create a registry key. If this key already exists, open it)

Source: Internet
Author: User

Regcreatekeyex

This function is used to create a registry key. If the key already exists, open it (the registry key is case-insensitive)

Long regcreatekeyex (
Hkey,
Lptstr lpsubkey,
DWORD reserved,
Lptstr lpclass,
DWORD dwoptions,
Regsam samdesired,
Lpsecurity_attributes lpsecurityattributes,
Phkey phkresult,
Lpdword lpdwdisposition
);

Parameters:
Hkey
Input parameter, a handle to open the key. The process that calls this function must have the power of key_create_sub_key. This handle can be the return value of regcreatekeyex or regopenkeyex, or the following predefined values
Hkey_classes_root
Hkey_current_config
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS

 

Lpsubkey
The input parameter that identifies the subkey name. This parameter cannot be blank. Parameter cannot exist (/)

 

Reserved
Reserved value, which must be 0

Lpclass
An input parameter pointing to a string that defines the type of the key. It can be null. This parameter can be used for local and remote registry operations.

 

Dwoptions
Input parameter, which can be the following values
Reg_option_backup_restore, 0x00000004l
Reg_option_non_volatile, 0x00000000l. This value is generally used.
Reg_option_volatile, 0x00000001l

Samdesired
Input parameter, access permission defined
 
Lpsecurityattributes
The input parameter defines whether the returned handle can be inherited by the quilt process. If it is null, it cannot be inherited.
 
Phkresult
Output parameter, save the returned handle

 

Lpdwdisposition
Output parameter, which can be the following values. If it is null, no result is returned.
Reg_created_new_key, 0x00000001l this key is newly created
Reg_opened_existing_key, 0x00000002l this key is an existing key

Return values
If the call succeeds, error_success is returned.

 

Remarks
The key created by this function has no key value. Applications cannot create direct subkeys for HKEY_USERS or HKEY_LOCAL_MACHINE.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.