Click to Rate and Give Feedback
MSDN
MSDN Library
User Interface
Windows Shell
Shell Reference
Registry Functions
 SHSetValue Function

  Switch on low bandwidth view
SHSetValue Function

Sets the value of a registry key.

Syntax

LSTATUS SHSetValue(      
    HKEY hkey,     LPCTSTR pszSubKey,     LPCTSTR pszValue,     DWORD dwType,     LPCVOID pvData,     DWORD cbData );

Parameters

hkey
[in] A handle to the currently open key, or any of the following predefined values.
HKEY_CLASSES_ROOT
HKEY_CURRENT_CONFIG
HKEY_CURRENT_USER
HKEY_DYN_DATA (Microsoft Windows 95 only)
HKEY_LOCAL_MACHINE
HKEY_PERFORMANCE_DATA (Microsoft Windows NT only)
HKEY_USERS
pszSubKey
[in] The address of a null-terminated string that specifies the name of the subkey with which a value is associated. This can be NULL or a pointer to an empty string. In this case, the value is added to the key identified by the hkey parameter.
pszValue
[in] The address of a null-terminated string that specifies the value. This value can be NULL.
dwType
[in] Type of data to be stored. This parameter must be the REG_SZ type. For more information, see Registry Data Types.
pvData
[in] Pointer to a buffer that contains the data to set for the specified value. This value can be NULL.
cbData
[in] Length, in bytes, of the buffer pointed to by the pvData parameter. If the data is a null-terminated string, this length includes the terminating null character.

Return Value

Returns ERROR_SUCCESS if successful; otherwise, a nonzero error code defined in Winerror.h. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to retrieve a generic description of the error.

Function Information

Minimum DLL Versionshlwapi.dll version 4.71 or later
Custom ImplementationNo
Headershlwapi.h
Import libraryshlwapi.lib
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0
UnicodeImplemented as ANSI and Unicode versions.
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker