RegistryKey.Handle RegistryKey.Handle RegistryKey.Handle Property


Gets a SafeRegistryHandle object that represents the registry key that the current RegistryKey object encapsulates.

 property Microsoft::Win32::SafeHandles::SafeRegistryHandle ^ Handle { Microsoft::Win32::SafeHandles::SafeRegistryHandle ^ get(); };
public Microsoft.Win32.SafeHandles.SafeRegistryHandle Handle { get; }
Public ReadOnly Property Handle As SafeRegistryHandle
Property Value

The handle to the registry key.


The registry key is closed. Closed keys cannot be accessed.

The user does not have the necessary registry rights.

A system error occurred, such as deletion of the current key.

The user does not have the permissions required to read the key.


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

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

Applies to