SKSetValueW

This function sets the data for a value in a subkey of a shell key.

Declaration

HRESULT
SKSetValueW (
    SHELLKEY nShellKey,
    LPCWSTR pszSubKey,
    LPCWSTR pszValue,
    DWORD dwType,
    LPVOID pvData,
    DWORD cbData);

Parameters

The nShellKey argument specifies the shell key as a constant from the SHELLKEY enumeration.

The pszSubKey argument provides the address of a null-terminated string that names the subkey, or is NULL for the shell key itself.

The pszValue argument provides the address of a null-terminated string that names the value, or is NULL for the default value.

The dwType argument provides the data type, e.g., REG_SZ or REG_DWORD.

The pvData argument provides the address of a buffer that contains the data.

The cbData argument provides the size of the data, in bytes.

Return Value

The function returns zero for success, else an error code.

Behaviour

The function creates the given subkey of the selected shell key (using SHGetShellKeyEx, asking for KEY_SET_VALUE access), sets the given data for the given value, and closes the subkey.

Variations

In builds before Windows Vista, the subkey is opened by using SHGetShellKey.

Availability

The SKSetValueW function is exported from SHLWAPI as ordinal 517 in version 6.00 and higher.

Though this function dates from 2001, it was still not documented by Microsoft as late as the January 2007 edition of the Windows Vista Software Development Kit (SDK).