Click or drag to resize

RegistryHelperRegDeleteKeyEx Method

Deletes a subkey and its values from the specified platform-specific view of the registry. Note that key names are not case sensitive. - To delete a subkey as a transacted operation, call the RegDeleteKeyTransacted function.

Namespace:  MFiles.VAF.Common
Assembly:  MFiles.VAF (in MFiles.VAF.dll) Version: 2.1.0.1 (2.1.0.1)
Syntax
C#
[DllImportAttribute("Advapi32.dll", EntryPoint = "RegDeleteKeyExW", CharSet = CharSet.Auto)]
public static int RegDeleteKeyEx(
	UIntPtr hKey,
	string lpSubKey,
	RegistryHelperRegSAM samDesired,
	uint reserved
)

Parameters

hKey
Type: SystemUIntPtr
A handle to an open registry key. The access rights of this key do not affect the delete operation. For more information about access rights, see Registry Key Security and Access Rights. This handle is returned by the RegCreateKeyEx or RegOpenKeyEx function, or it can be one of the following predefined keys: HKEY_CLASSES_ROOT HKEY_CURRENT_CONFIG HKEY_CURRENT_USER HKEY_LOCAL_MACHINE HKEY_USERS
lpSubKey
Type: SystemString
- The name of the key to be deleted. This key must be a subkey of the key specified by the value of the hKey parameter. - The function opens the subkey with the DELETE access right. - Key names are not case sensitive. - The value of this parameter cannot be NULL.
samDesired
Type: MFiles.VAF.CommonRegistryHelperRegSAM
An access mask the specifies the platform-specific view of the registry. KEY_WOW64_32KEY => 0x0200 - Delete the key from the 32-bit registry view. KEY_WOW64_64KEY => 0x0100 - Delete the key from the 64-bit registry view.
reserved
Type: SystemUInt32
This parameter is reserved and must be zero.

Return Value

Type: Int32
- 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.
See Also