RegistryKey.FromHandle RegistryKey.FromHandle RegistryKey.FromHandle Method

Definition

Creates a registry key from a specified handle.

Overloads

FromHandle(SafeRegistryHandle) FromHandle(SafeRegistryHandle) FromHandle(SafeRegistryHandle)

Creates a registry key from a specified handle.

FromHandle(SafeRegistryHandle, RegistryView) FromHandle(SafeRegistryHandle, RegistryView) FromHandle(SafeRegistryHandle, RegistryView)

Creates a registry key from a specified handle and registry view setting.

FromHandle(SafeRegistryHandle) FromHandle(SafeRegistryHandle) FromHandle(SafeRegistryHandle)

Creates a registry key from a specified handle.

public:
 static Microsoft::Win32::RegistryKey ^ FromHandle(Microsoft::Win32::SafeHandles::SafeRegistryHandle ^ handle);
[System.Runtime.InteropServices.ComVisible(false)]
public static Microsoft.Win32.RegistryKey FromHandle (Microsoft.Win32.SafeHandles.SafeRegistryHandle handle);
Public Shared Function FromHandle (handle As SafeRegistryHandle) As RegistryKey
Parameters
handle
SafeRegistryHandle SafeRegistryHandle SafeRegistryHandle

The handle to the registry key.

Returns
Exceptions

The user does not have the necessary registry rights.

The user does not have the permissions required to perform this action.

Security

SecurityCriticalAttribute
requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.

SecurityPermission
for the ability to access the specified registry key if it is a remote key. Associated enumeration: UnmanagedCode

FromHandle(SafeRegistryHandle, RegistryView) FromHandle(SafeRegistryHandle, RegistryView) FromHandle(SafeRegistryHandle, RegistryView)

Creates a registry key from a specified handle and registry view setting.

public:
 static Microsoft::Win32::RegistryKey ^ FromHandle(Microsoft::Win32::SafeHandles::SafeRegistryHandle ^ handle, Microsoft::Win32::RegistryView view);
[System.Runtime.InteropServices.ComVisible(false)]
public static Microsoft.Win32.RegistryKey FromHandle (Microsoft.Win32.SafeHandles.SafeRegistryHandle handle, Microsoft.Win32.RegistryView view);
Public Shared Function FromHandle (handle As SafeRegistryHandle, view As RegistryView) As RegistryKey
Parameters
handle
SafeRegistryHandle SafeRegistryHandle SafeRegistryHandle

The handle to the registry key.

view
RegistryView RegistryView RegistryView

The registry view to use.

Returns
Exceptions

The user does not have the necessary registry rights.

The user does not have the permissions required to perform this action.

Remarks

The view parameter for this method is used in subsequent operations, such as opening subkeys.

If view is Registry64 but the machine is running a 32-bit operating system, the returned key will use the Registry32 view.

Security

SecurityCriticalAttribute
requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.

SecurityPermission
for the ability to access the specified registry key if it is a remote key. Associated enumeration: UnmanagedCode

Applies to