Registry_SetKeyValue()

Examples


The Registry_SetKeyValue() function sets the specified value in the registry.

Syntax

Registry_SetKeyValue(subtree, key, value_name, value {, error_code})

Parameters

subtree – An integer specifying the registry subtree. The value corresponds to one of the following constants:

[spacer]

Constant

Description

REGKEY_CLASSES_ROOT

HKEY_CLASSES_ROOT subtree

REGKEY_CURRENT_USER

HKEY_CURRENT_USER subtree

REGKEY_LOCAL_MACHINE

HKEY_LOCAL_MACHINE subtree

REGKEY_CURRENT_CONFIG

HKEY_CURRENT_CONFIG subtree


key – A string specifying the path of the key that contains the value to set. The path value begins with the key name followed by the subkey names. The values in the path are separated by backslash (\) characters. If the path doesn’t exist in the registry, it will be created.

value_name – The name of the value to set.

value – The value to set. The data type depends on the type of value being set in the registry.

error_code – An optional returned long integer that contains the error code that was returned. The error codes are defined in the WinError.h file of the Windows SDK.

Return value

A boolean indicating the result. The value true indicates the function succeeded, while false indicates it did not.


Documentation Feedback