SHRegSetUSValueSHRegSetUSValue*
*Contents  *Index  *Topic Contents
*Previous Topic: SHRegQueryUSValue
*Next Topic: SHRegWriteUSValue

SHRegSetUSValue


LONG SHRegSetUSValue(
    LPCTSTR pszSubKey,
    LPCTSTR pszValue,
    DWORD   dwType,
    LPVOID  pvData,
    DWORD   cbData,
    DWORD   dwFlags
    );

Sets a user-specific registry value.

pszSubKey
Handle to the currently open subkey, or any of the following predefined handle values:
HKEY_CURRENT_USER
HKEY_CURRENT_USER_RELATIVE
HKEY_DYN_DATA (Windows 95 only)
HKEY_LOCAL_MACHINE
HKEY_LOCAL_MACHINE_RELATIVE
HKEY_PERFORMANCE_DATA (Windows NT only)
pszValue
Address of the null-terminated string that specifies the name of the value.
dwType
Type of data to be stored. This parameter must be the REG_SZ type. For more information, see HKEY_TYPE.
pvData
Address of a null-terminated string that contains the value to be set for the specified key.
cbData
Length, in bytes, of the string pointed to by the pvData parameter, not including the terminating null character.
dwFlags
Indicates whether to create/open HKCU, HKLM, or both.

Note If your code involves setting a series of values in the same key, rather than use this function repeatedly, it is better to open the key once and then call SHRegWriteUSValue.


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.