WinReg – Windows Registry API

The WinReg API provides a set of functions for interacting with the Windows Registry. It enables applications to create, read, update, and delete registry keys and values.

Key Functions

Typical Usage Pattern

#include <windows.h>
#include <stdio.h>

int main() {
    HKEY hKey;
    LONG result = RegOpenKeyEx(HKEY_CURRENT_USER,
                               L"Software\\MyApp",
                               0,
                               KEY_READ | KEY_WRITE,
                               &hKey);
    if (result == ERROR_SUCCESS) {
        // Read or write values
        RegCloseKey(hKey);
    } else {
        wprintf(L"Failed to open key: %ld\\n", result);
    }
    return 0;
}

Related Topics