Exporter (0) Imprimer
Développer tout
Ce contenu n’est pas disponible dans votre langue. Voici la version anglaise.

RegDeleteValue function

Removes a named value from the specified registry key. Note that value names are not case sensitive.


LONG WINAPI RegDeleteValue(
  _In_      HKEY hKey,
  _In_opt_  LPCTSTR lpValueName


hKey [in]

A handle to an open registry key. The key must have been opened with the KEY_SET_VALUE access right. For more information, see Registry Key Security and Access Rights.

This handle is returned by the RegCreateKeyEx, RegCreateKeyTransacted, RegOpenKeyEx, or RegOpenKeyTransacted function. It can also be one of the following predefined keys:

lpValueName [in, optional]

The registry value to be removed. 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 value

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.


Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]


Winreg.h (include Windows.h)





Unicode and ANSI names

RegDeleteValueW (Unicode) and RegDeleteValueA (ANSI)

See also

Registry Functions
Registry Overview



Ajouts de la communauté

Microsoft réalise une enquête en ligne pour recueillir votre opinion sur le site Web de MSDN. Si vous choisissez d’y participer, cette enquête en ligne vous sera présentée lorsque vous quitterez le site Web de MSDN.

Si vous souhaitez y participer,
© 2014 Microsoft