RegCloseKey

  LONG RegCloseKey(hkey)    
  HKEY hkey; /* handle of key to close */

The RegCloseKey function releases the key's handle.

Parameters

hkey

Identifies the open key to close.

Return Value

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

Comments

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

See Also

RegCreateKey, RegDeleteKey, RegOpenKey, RegSetValue