Registry API

This section details the Windows Registry functions, structures, and constants used for managing the system's registry database. The registry stores configuration settings for the operating system and for applications that are designed to use the registry.

Functions

The following functions are available for interacting with the Windows Registry:

Function Name Description
RegOpenKeyEx Opens an existing key in the registry or creates a new key if it does not exist.
RegCreateKeyEx Creates the specified key or opens it if it already exists.
RegCloseKey Closes an open handle to a registry key.
RegQueryValueEx Retrieves the data and type for a specified registry value.
RegSetValueEx Sets the data and attributes of a specified registry value.
RegEnumKeyEx Enumerates the subkeys of the specified open registry key.
RegDeleteKey Deletes a subkey and its values from the registry.
RegConnectRegistry Establishes a connection to a specified remote registry.

Structures

Key structures used with the Registry API:

Structure Name Description
HKEY Represents a handle to a registry key.
VALENT Contains information about a registry value.
REG_DWORD Data type for a 32-bit unsigned integer.
REG_SZ Data type for a null-terminated string.

Constants

Important constants used in the Registry API:

Constant Description
HKEY_CLASSES_ROOT Root handle for the HKEY_CLASSES_ROOT registry key.
HKEY_CURRENT_USER Root handle for the HKEY_CURRENT_USER registry key.
HKEY_LOCAL_MACHINE Root handle for the HKEY_LOCAL_MACHINE registry key.
HKEY_USERS Root handle for the HKEY_USERS registry key.
KEY_READ Specifies read access to a registry key.
KEY_WRITE Specifies write access to a registry key.