Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function removes a named value from the specified registry key.

A remote application interface (RAPI) version of this function exists called CeRegDeleteValue (RAPI).

Syntax

LONG RegDeleteValue( 
  HKEY 
hKey, 
  LPCWSTR 
lpValueName 
); 

Parameters

hKey

[in] Handle to a currently open key or any of the following predefined reserved handle values:

  • HKEY_LOCAL_MACHINE

  • HKEY_CLASSES_ROOT

  • HKEY_CURRENT_USER

  • HKEY_USERS

lpValueName

[in] Pointer to a null-terminated string that names the value to remove. If this parameter is set to NULL or points to an empty string, the default value of the key is removed. A default value is created by calling the RegSetValueExfunction with a NULL or empty string value name.

Return Value

ERROR_SUCCESS indicates success. A nonzero error code defined in Winerror.h indicates failure. To get a generic description of the error, call the FormatMessagefunction with the FORMAT_MESSAGE_FROM_SYSTEM flag set. The message resource is optional, so FormatMessagemight fail.

Requirements

Header winreg.h
Library coredll.lib
Windows Embedded CE Windows CE 1.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also