RegCloseKey

RegCloseKey a handle to the specified registry key.

Syntax

LONG RegCloseKey(
    HKEY  hKey 
  );

Parameters

hKey

A handle to the open key to be closed. The handle must have been opened by the RegCreateKey, RegCreateKeyEx, RegOpenKey or RegOpenKeyEx function.

Return Value

If the function succeeds, the return value is ERROR_SUCCESS. If the function fails the return value is a nonzero error code.

Remarks

The handle for a specified key should not be used after it has been closed, because it will no longer be valid. Key handles should not be left open any longer than necessary.

Requirements

Minimum Supported Version RTX64 2013
Header windows.h
Library Rtx_Rtss.lib

See Also:

Registry API

RegCreateKey

RegCreateKeyEx

RegDeleteKey

RegOpenKey

RegOpenKeyEx