---
name: "SHSetValueA"
section: "3w"
platform: "linux"
package: "libwine-dev"
version: "1.4.1-4"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/SHSetValueA"
---

# SHSetValueA(3w)

## NAME

**SHSetValueA** (SHLWAPI.@)

## SYNOPSIS

DWORD SHSetValueA\
  (\
   HKEY    *hKey*,\
   LPCSTR  *lpszSubKey*,\
   LPCSTR  *lpszValue*,\
   DWORD   *dwType*,\
   LPCVOID *pvData*,\
   DWORD   *cbData*\
  )

## DESCRIPTION

Set a value in the registry.

## PARAMS

*hKey* **\[In\]**  Handle to registry key.

*lpszSubKey* **\[In\]**  Name of sub key under *hKey*.

*lpszValue* **\[In\]**  Name of value to set.

*dwType* **\[In\]**  Type of the value.

*pvData* **\[In\]**  Data of the value.

*cbData* **\[In\]**  Size of the value.

## RETURNS

**Success:** **ERROR\_SUCCESS**. The value is set with the data given.

**Failure:** An error code from **[RegCreateKeyExA(3w)](/RegCreateKeyExA/3w.md)** or **[RegSetValueExA(3w)](/RegSetValueExA/3w.md)**.

## NOTES

If *lpszSubKey* does not exist, it is created before the value is set. If *lpszSubKey* is **NULL** or an empty string, then the value is added directly to *hKey* instead.

## IMPLEMENTATION

Declared in **"shlwapi.h"**.

Implemented in **"dlls/shlwapi/reg.c"**.

Debug channel **"shell"**.
