Platform SDK: Windows System Information
RegDeleteValue
The RegDeleteValue function removes a named value from the specified registry key.
LONG RegDeleteValue(
HKEY hKey, // handle to key
LPCTSTR lpValueName // value name
);Parameters
hKey
[in] Handle to an open key. This handle is returned by the RegCreateKeyEx or RegOpenKeyEx function, or it can be one of the following predefined keys:
HKEY_CLASSES_ROOT
HKEY_CURRENT_CONFIG
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
Windows 95/98/Me: HKEY_DYN_DATA
The key must have been opened with the KEY_SET_VALUE access right. For more information, see Registry Key Security and Access Rights.
lpValueName
[in] Pointer to a null-terminated string that names the value to remove. If this parameter is NULL or an empty string, the value set by the RegSetValue function is removed.
For more information, see Registry Element Size Limits.
Return Values
If the function succeeds, the return value is ERROR_SUCCESS.
If the function fails, the return value is a nonzero error code defined in Winerror.h. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.
Remarks
Windows 95/98/Me: RegDeleteValueW is supported by the Microsoft Layer for Unicode. To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Winreg.h; include Windows.h.
Library: Use Advapi32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000/XP. Also supported by Microsoft Layer for Unicode.