AdvApi32RegUnLoadKey(RegistryHive, String) Method

Unloads the specified registry key and its subkeys from the registry.

Applications that back up or restore system state including system files and registry hives should use the Volume Shadow Copy service instead of the registry functions.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("AdvApi32.dll", CharSet = CharSet.Auto, BestFitMapping = false, 
	ThrowOnUnmappableChar = true, SetLastError = true)]
public static Win32ErrorCode RegUnLoadKey(
	RegistryHive hive,
	string subKey
)

Parameters

hive  RegistryHive
The key where the subkey will be unloaded.
subKey  String
The name of the subkey to be unloaded.

The key referred to by the subKey parameter must have been created by using the RegLoadKey(RegistryHive, String, String) function.

Key names are not case sensitive.

Return Value

Win32ErrorCode
If the function succeeds, the return value is ERROR_SUCCESS.

If the function fails, the return value is other Win32ErrorCode error code.

To get extended error information, call GetLastWin32Error.

Remarks

See Also