SHRegSetValue

Go to Home Page

Sets a value in a registry key

Syntax

LONG WINAPI SHRegSetValue (
    HKEY hKey,
    LPCWSTR pwszSubKey,
    LPCWSTR pwszValueName,
    SRRF srrfFlags,
    DWORD dwType,
    PVOID pData,
    DWORD cbData
)

Parameters

hKey
A handle to an open registry key
pwszSubKey
A pointer to a null-terminated string that specifies the relative path from hkey to the subkey to retrieve the value from. This parameter can be NULL or an empty string, in which case the data is retrieved from the hkey location.
pwszValueName
A pointer to a null-terminated string that contains the name of the value. This parameter can be NULL or an empty string, in which case the data is retrieved from the Default value.
srrfFlags
Unused
dwType
The registry type of the data pointer to by pData
pData
A pointer to the data to be written
cbData
The size of the data pointed to by pData

Return Value

An ERROR_ value

Remarks

If pwszSubkey is not NULL, the function is a simple wrapper around RegCreateKeyEx, RegSetValueEx, and RegCloseKey. If pwszSubKey isn't set, the function simple calls RegSetValueEx.

This function is also known as _SHRegSetValue@28.