Platform SDK: Registry |
The RegUnLoadKey function unloads the specified registry key and its subkeys from the registry.
LONG RegUnLoadKey( HKEY hKey, // handle to open key LPCTSTR lpSubKey // subkey name );
HKEY_LOCAL_MACHINE
HKEY_USERS
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.
This function removes a hive from the registry but does not modify the file containing the registry information. A hive is a discrete body of keys, subkeys, and values that is rooted at the top of the registry hierarchy.
Windows NT/2000: The calling process must have the SE_RESTORE_NAME privilege. For more information about privileges, see Privileges.
Windows 95/98: No registry subkey or value name may exceed 255 characters.
Windows NT/2000: Requires Windows NT 3.1 or later.
Windows 95/98: Requires Windows 95 or later.
Header: Declared in Winreg.h; include Windows.h.
Library: Use Advapi32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.
Registry Overview, Registry Functions, RegConnectRegistry, RegDeleteKey, RegLoadKey, RegRestoreKey