set_registry_value


template<class character>
int set_registry_value(handle Key,
                         const character* name,
                         unsigned teserved,
                         unsigned type,
                         const byte* data,
                         unsigned data_length)

This function sets the data and type of a value.

Parameters

handle key

The handle of the key for which data is being set.

const character* name

The name of the value whose data and type are being set. If null or a zero length string is specified, the default value is being set for the key.

unsigned reserved

Reserved - must be zero.

unsigned type

The type of the value whose data is being set.

const byte* data

A pointer to a buffer holding the data for the key.

unsigned data_length

The length of the data being set. For string types, the length should include the null terminator.

Return

int

0 The function succeeded.
Other The call failed - a Win32 error code is returned.

Notes

If the data for a value exceeds 2048 bytes, the data should be stored in a file and the name of that file stored in the registry. Elements such as bitmaps and icons should be stored in this way.

Single byte strings are converted to unicode; hence, they are stored in double byte format.

The access key_access::set_value is required for the key. The access key_access::write includes access key_access::set_value.