RegDeleteValue

  LONG RegDeleteValue(hkey, lpszValue)    
  HKEY hkey; /* identifies key to remove value for */
  LPTSTR lpszValue; /* address of value name */

The RegDeleteValue function removes a named value from the specified configuration registry key.

Parameters

hkey

Identifies a currently open key or any of the following predefined reserved handle values:

HKEY_CLASSES_ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE HKEY_USERS

lpszValue

Points to a null-terminated string that names the value to remove. If this value is NULL or points to an empty string, the value set by the RegSetValue function is removed.

Return Value

The return value is ERROR_SUCCESS if the function is successful. Otherwise, it is an error value.

Comments

The key specified by hkey must have been opened with KEY_SET_VALUE access (KEY_WRITE access includes KEY_SET_VALUE).

The RegDeleteValue function may be used as either a wide-character function (where text arguments must use Unicode) or an ANSI function (where text arguments must use characters from the Windows 3.x character set installed).

See Also

RegSetValue, RegSetValueEx