CRegKey::SetValue

LONG SetValue( DWORD dwValue, LPCTSTR lpszValueName );

LONG SetValue( LPCTSTR lpszValue, LPCTSTR lpszValueName = NULL );

LONG SetValue( HKEY hKeyParent, LPCTSTR lpszKeyName, LPCTSTR lpszValue, LPCTSTR lpszValueName = NULL );

Return Value

If successful, returns ERROR_SUCCESS; otherwise, an error value.

Parameters

dwValue

[in] Specifies the data to be stored.

lpszValueName

[in] Specifies the value field to be set. If a value field with this name does not already exist in the key, it is added.

lpszValue

[in] Specifies the data to be stored. This parameter must be non-NULL.

hKeyParent

[in] The handle of an open key.

lpszKeyName

[in] Specifies the name of a key to be created or opened. This name must be a subkey of hKeyParent.

Remarks

Stores data in the specified value field of an open registry key. The first two versions of SetValue use m_hKey as the open key. The third version allows you to create or open a subkey of hKeyParent, and then set the value field of the subkey.

CRegKey OverviewClass Members

See Also   CRegKey::SetKeyValue