Asposecpplib
Microsoft::Win32::RegistryKey Class Reference

API to manipulate registry values. Support is very limited and Windows-only. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument. More...

Inherits System::Object.

Public Member Functions

virtual ASPOSECPP_SHARED_API ~RegistryKey () override
 Destructor. More...
 
ASPOSECPP_SHARED_API System::SharedPtr< SafeRegistryHandle > get_Handle ()
 Gets raw handle of registry key. Not implemented. More...
 
ASPOSECPP_SHARED_API System::String get_Name ()
 Gets name of registry key. Not implemented. More...
 
ASPOSECPP_SHARED_API int get_SubKeyCount ()
 Gets number of subkeys. Not implemented. More...
 
ASPOSECPP_SHARED_API int get_ValueCount ()
 Gets number of values. Not implemented. More...
 
ASPOSECPP_SHARED_API RegistryView get_View ()
 Gets view of registry key. Not implemented. More...
 
ASPOSECPP_SHARED_API void Close ()
 Closes registry key. Not implemented. More...
 
ASPOSECPP_SHARED_API System::SharedPtr< RegistryKeyCreateSubKey (const System::String &subkey)
 Creates subkey under current key. Not implemented. More...
 
ASPOSECPP_SHARED_API System::SharedPtr< RegistryKeyCreateSubKey (const System::String &subkey, RegistryKeyPermissionCheck permissionCheck)
 Creates subkey under current key. Not implemented. More...
 
ASPOSECPP_SHARED_API System::SharedPtr< RegistryKeyCreateSubKey (const System::String &subkey, RegistryKeyPermissionCheck permissionCheck, const System::SharedPtr< RegistrySecurity > &registrySecurity)
 Creates subkey under current key. Not implemented. More...
 
ASPOSECPP_SHARED_API System::SharedPtr< RegistryKeyCreateSubKey (const System::String &subkey, RegistryKeyPermissionCheck permissionCheck, RegistryOptions options)
 Creates subkey under current key. Not implemented. More...
 
ASPOSECPP_SHARED_API System::SharedPtr< RegistryKeyCreateSubKey (const System::String &subkey, RegistryKeyPermissionCheck permissionCheck, RegistryOptions registryOptions, const System::SharedPtr< RegistrySecurity > &registrySecurity)
 Creates subkey under current key. Not implemented. More...
 
ASPOSECPP_SHARED_API void DeleteSubKey (const System::String &subkey)
 Deletes subkey under current key. Not implemented. More...
 
ASPOSECPP_SHARED_API void DeleteSubKey (const System::String &subkey, bool throwOnMissingSubKey)
 Deletes subkey under current key. Not implemented. More...
 
ASPOSECPP_SHARED_API void DeleteSubKeyTree (const System::String &subkey)
 Deletes subkey tree under current key. Not implemented. More...
 
ASPOSECPP_SHARED_API void DeleteSubKeyTree (const System::String &subkey, bool throwOnMissingSubKey)
 Deletes subkey tree under current key. Not implemented. More...
 
ASPOSECPP_SHARED_API void DeleteValue (const System::String &name)
 Deletes value of current key. Not implemented. More...
 
ASPOSECPP_SHARED_API void DeleteValue (const System::String &name, bool throwOnMissingValue)
 Deletes value of current key. Not implemented. More...
 
ASPOSECPP_SHARED_API void Dispose ()
 Frees handles associated with key. Not implemented. More...
 
ASPOSECPP_SHARED_API void Flush ()
 Writes all attributes of key to registry. Not implemented. More...
 
ASPOSECPP_SHARED_API System::SharedPtr< RegistrySecurity > GetAccessControl ()
 Gets access control object associated with key. Not implemented. More...
 
ASPOSECPP_SHARED_API System::SharedPtr< RegistrySecurity > GetAccessControl (AccessControlSections includeSections)
 Gets access control object associated with key. Not implemented. More...
 
ASPOSECPP_SHARED_API System::ArrayPtr< System::StringGetSubKeyNames ()
 Enumerates subkeys. Not implemented. More...
 
ASPOSECPP_SHARED_API System::SharedPtr< System::ObjectGetValue (const System::String &valueName)
 Gets key value. Windows only. More...
 
ASPOSECPP_SHARED_API System::SharedPtr< System::ObjectGetValue (const System::String &name, const System::SharedPtr< System::Object > &defaultValue)
 Gets key value. Not implemented. More...
 
ASPOSECPP_SHARED_API System::SharedPtr< System::ObjectGetValue (const System::String &name, const System::SharedPtr< System::Object > &defaultValue, RegistryValueOptions options)
 Gets key value. Not implemented. More...
 
ASPOSECPP_SHARED_API RegistryValueKind GetValueKind (const System::String &name)
 Gets key value type. Not implemented. More...
 
ASPOSECPP_SHARED_API System::ArrayPtr< System::StringGetValueNames ()
 Gets list of value names under current key. More...
 
ASPOSECPP_SHARED_API System::SharedPtr< RegistryKeyOpenSubKey (const System::String &name)
 Opens subkey of current key. More...
 
ASPOSECPP_SHARED_API System::SharedPtr< RegistryKeyOpenSubKey (const System::String &name, RegistryKeyPermissionCheck permissionCheck)
 Opens subkey of current key. Not implemented. More...
 
ASPOSECPP_SHARED_API System::SharedPtr< RegistryKeyOpenSubKey (const System::String &name, bool writable)
 Opens subkey of current key. Not implemented. More...
 
ASPOSECPP_SHARED_API System::SharedPtr< RegistryKeyOpenSubKey (const System::String &name, RegistryKeyPermissionCheck permissionCheck, RegistryRights rights)
 Opens subkey of current key. Not implemented. More...
 
ASPOSECPP_SHARED_API void SetAccessControl (const System::SharedPtr< RegistrySecurity > &registrySecurity)
 Sets access control value. Not implemented. More...
 
ASPOSECPP_SHARED_API void SetValue (const System::String &name, const System::SharedPtr< System::Object > &value)
 Sets registry value. Not implemented. More...
 
ASPOSECPP_SHARED_API void SetValue (const System::String &name, const System::SharedPtr< System::Object > &value, RegistryValueKind valueKind)
 Sets registry value. Not implemented. More...
 
ASPOSECPP_SHARED_API System::String ToString () const override
 Converts key to string. Not implemented. More...
 
- Public Member Functions inherited from System::Object
ASPOSECPP_SHARED_API Object ()
 Creates object. Initializes all internal data structures. More...
 
virtual ASPOSECPP_SHARED_API ~Object ()
 Destroys object. Frees all internal data structures. More...
 
ASPOSECPP_SHARED_API Object (Object const &x)
 Copy constructor. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
Objectoperator= (Object const &x)
 Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
ObjectSharedRefAdded ()
 Increments shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int SharedRefRemovedSafe ()
 Decrements and returns shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int RemovedSharedRefs (int count)
 Decreases shared reference count by specified value. More...
 
Detail::SmartPtrCounter * WeakRefAdded ()
 Increments weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
void WeakRefRemoved ()
 Decrements weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
Detail::SmartPtrCounter * GetCounter ()
 Gets reference counter data structure associated with the object. More...
 
int SharedCount () const
 Gets current value of shared reference counter. More...
 
ASPOSECPP_SHARED_API void Lock ()
 Implements C# lock() statement locking. Call directly or use LockContext sentry object. More...
 
ASPOSECPP_SHARED_API void Unlock ()
 Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More...
 
virtual ASPOSECPP_SHARED_API bool Equals (ptr obj)
 Compares objects using C# Object.Equals semantics. More...
 
virtual ASPOSECPP_SHARED_API int32_t GetHashCode () const
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More...
 
virtual ASPOSECPP_SHARED_API ptr MemberwiseClone () const
 Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More...
 
virtual ASPOSECPP_SHARED_API const TypeInfoGetType () const
 Gets actual type of object. Analog of C# System.Object.GetType() call. More...
 
virtual ASPOSECPP_SHARED_API bool Is (const TypeInfo &targetType) const
 Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More...
 
virtual ASPOSECPP_SHARED_API void SetTemplateWeakPtr (uint32_t argument)
 Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More...
 
virtual ASPOSECPP_SHARED_API bool FastCast (const Details::FastRttiBase &helper, void **out_ptr) const
 For internal purposes only. More...
 
template<>
bool ReferenceEquals (String const &str, std::nullptr_t)
 Specialization of Object::ReferenceEquals for case of string and nullptr. More...
 
template<>
bool ReferenceEquals (String const &str1, String const &str2)
 Specialization of Object::ReferenceEquals for case of strings. More...
 

Static Public Member Functions

static ASPOSECPP_SHARED_API System::SharedPtr< RegistryKeyFromHandle (const System::SharedPtr< SafeRegistryHandle > &handle)
 Opens key from handle. Not implemented. More...
 
static ASPOSECPP_SHARED_API System::SharedPtr< RegistryKeyFromHandle (const System::SharedPtr< SafeRegistryHandle > &handle, RegistryView view)
 Opens key from handle. Not implemented. More...
 
static ASPOSECPP_SHARED_API System::SharedPtr< RegistryKeyOpenBaseKey (RegistryHive hKey, RegistryView view)
 Opens base key. Not implemented. More...
 
static ASPOSECPP_SHARED_API System::SharedPtr< RegistryKeyOpenRemoteBaseKey (RegistryHive hKey, const System::String &machineName)
 Opens base key on remote host. Not implemented. More...
 
static ASPOSECPP_SHARED_API System::SharedPtr< RegistryKeyOpenRemoteBaseKey (RegistryHive hKey, const System::String &machineName, RegistryView view)
 Opens base key on remote host. Not implemented. More...
 
- Static Public Member Functions inherited from System::Object
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 Reference-compares value type object with nullptr. More...
 
template<typename T1 , typename T2 >
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares reference type objects in C# style. More...
 
template<typename T1 , typename T2 >
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares value type objects in C# style. More...
 
static const TypeInfoType ()
 Implements C# typeof(System.Object) construct. More...
 
template<>
bool Equals (float const &objA, float const &objB)
 Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN. More...
 
template<>
bool Equals (double const &objA, double const &objB)
 Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN. More...
 

Additional Inherited Members

- Public Types inherited from System::Object
typedef SmartPtr< Objectptr
 Alias for smart pointer type. More...
 

Detailed Description

API to manipulate registry values. Support is very limited and Windows-only. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument.

Constructor & Destructor Documentation

◆ ~RegistryKey()

virtual ASPOSECPP_SHARED_API Microsoft::Win32::RegistryKey::~RegistryKey ( )
overridevirtual

Destructor.

Member Function Documentation

◆ Close()

ASPOSECPP_SHARED_API void Microsoft::Win32::RegistryKey::Close ( )

Closes registry key. Not implemented.

◆ CreateSubKey() [1/5]

ASPOSECPP_SHARED_API System::SharedPtr<RegistryKey> Microsoft::Win32::RegistryKey::CreateSubKey ( const System::String subkey)

Creates subkey under current key. Not implemented.

◆ CreateSubKey() [2/5]

ASPOSECPP_SHARED_API System::SharedPtr<RegistryKey> Microsoft::Win32::RegistryKey::CreateSubKey ( const System::String subkey,
RegistryKeyPermissionCheck  permissionCheck 
)

Creates subkey under current key. Not implemented.

◆ CreateSubKey() [3/5]

ASPOSECPP_SHARED_API System::SharedPtr<RegistryKey> Microsoft::Win32::RegistryKey::CreateSubKey ( const System::String subkey,
RegistryKeyPermissionCheck  permissionCheck,
const System::SharedPtr< RegistrySecurity > &  registrySecurity 
)

Creates subkey under current key. Not implemented.

◆ CreateSubKey() [4/5]

ASPOSECPP_SHARED_API System::SharedPtr<RegistryKey> Microsoft::Win32::RegistryKey::CreateSubKey ( const System::String subkey,
RegistryKeyPermissionCheck  permissionCheck,
RegistryOptions  options 
)

Creates subkey under current key. Not implemented.

◆ CreateSubKey() [5/5]

ASPOSECPP_SHARED_API System::SharedPtr<RegistryKey> Microsoft::Win32::RegistryKey::CreateSubKey ( const System::String subkey,
RegistryKeyPermissionCheck  permissionCheck,
RegistryOptions  registryOptions,
const System::SharedPtr< RegistrySecurity > &  registrySecurity 
)

Creates subkey under current key. Not implemented.

◆ DeleteSubKey() [1/2]

ASPOSECPP_SHARED_API void Microsoft::Win32::RegistryKey::DeleteSubKey ( const System::String subkey)

Deletes subkey under current key. Not implemented.

◆ DeleteSubKey() [2/2]

ASPOSECPP_SHARED_API void Microsoft::Win32::RegistryKey::DeleteSubKey ( const System::String subkey,
bool  throwOnMissingSubKey 
)

Deletes subkey under current key. Not implemented.

◆ DeleteSubKeyTree() [1/2]

ASPOSECPP_SHARED_API void Microsoft::Win32::RegistryKey::DeleteSubKeyTree ( const System::String subkey)

Deletes subkey tree under current key. Not implemented.

◆ DeleteSubKeyTree() [2/2]

ASPOSECPP_SHARED_API void Microsoft::Win32::RegistryKey::DeleteSubKeyTree ( const System::String subkey,
bool  throwOnMissingSubKey 
)

Deletes subkey tree under current key. Not implemented.

◆ DeleteValue() [1/2]

ASPOSECPP_SHARED_API void Microsoft::Win32::RegistryKey::DeleteValue ( const System::String name)

Deletes value of current key. Not implemented.

◆ DeleteValue() [2/2]

ASPOSECPP_SHARED_API void Microsoft::Win32::RegistryKey::DeleteValue ( const System::String name,
bool  throwOnMissingValue 
)

Deletes value of current key. Not implemented.

◆ Dispose()

ASPOSECPP_SHARED_API void Microsoft::Win32::RegistryKey::Dispose ( )

Frees handles associated with key. Not implemented.

◆ Flush()

ASPOSECPP_SHARED_API void Microsoft::Win32::RegistryKey::Flush ( )

Writes all attributes of key to registry. Not implemented.

◆ FromHandle() [1/2]

static ASPOSECPP_SHARED_API System::SharedPtr<RegistryKey> Microsoft::Win32::RegistryKey::FromHandle ( const System::SharedPtr< SafeRegistryHandle > &  handle)
static

Opens key from handle. Not implemented.

◆ FromHandle() [2/2]

static ASPOSECPP_SHARED_API System::SharedPtr<RegistryKey> Microsoft::Win32::RegistryKey::FromHandle ( const System::SharedPtr< SafeRegistryHandle > &  handle,
RegistryView  view 
)
static

Opens key from handle. Not implemented.

◆ get_Handle()

ASPOSECPP_SHARED_API System::SharedPtr<SafeRegistryHandle> Microsoft::Win32::RegistryKey::get_Handle ( )

Gets raw handle of registry key. Not implemented.

◆ get_Name()

ASPOSECPP_SHARED_API System::String Microsoft::Win32::RegistryKey::get_Name ( )

Gets name of registry key. Not implemented.

◆ get_SubKeyCount()

ASPOSECPP_SHARED_API int Microsoft::Win32::RegistryKey::get_SubKeyCount ( )

Gets number of subkeys. Not implemented.

◆ get_ValueCount()

ASPOSECPP_SHARED_API int Microsoft::Win32::RegistryKey::get_ValueCount ( )

Gets number of values. Not implemented.

◆ get_View()

ASPOSECPP_SHARED_API RegistryView Microsoft::Win32::RegistryKey::get_View ( )

Gets view of registry key. Not implemented.

◆ GetAccessControl() [1/2]

ASPOSECPP_SHARED_API System::SharedPtr<RegistrySecurity> Microsoft::Win32::RegistryKey::GetAccessControl ( )

Gets access control object associated with key. Not implemented.

◆ GetAccessControl() [2/2]

ASPOSECPP_SHARED_API System::SharedPtr<RegistrySecurity> Microsoft::Win32::RegistryKey::GetAccessControl ( AccessControlSections  includeSections)

Gets access control object associated with key. Not implemented.

◆ GetSubKeyNames()

ASPOSECPP_SHARED_API System::ArrayPtr<System::String> Microsoft::Win32::RegistryKey::GetSubKeyNames ( )

Enumerates subkeys. Not implemented.

◆ GetValue() [1/3]

ASPOSECPP_SHARED_API System::SharedPtr<System::Object> Microsoft::Win32::RegistryKey::GetValue ( const System::String name,
const System::SharedPtr< System::Object > &  defaultValue 
)

Gets key value. Not implemented.

◆ GetValue() [2/3]

ASPOSECPP_SHARED_API System::SharedPtr<System::Object> Microsoft::Win32::RegistryKey::GetValue ( const System::String name,
const System::SharedPtr< System::Object > &  defaultValue,
RegistryValueOptions  options 
)

Gets key value. Not implemented.

◆ GetValue() [3/3]

ASPOSECPP_SHARED_API System::SharedPtr<System::Object> Microsoft::Win32::RegistryKey::GetValue ( const System::String valueName)

Gets key value. Windows only.

Parameters
valueNameName of the value under current key.
Returns
Boxed value of key.

◆ GetValueKind()

ASPOSECPP_SHARED_API RegistryValueKind Microsoft::Win32::RegistryKey::GetValueKind ( const System::String name)

Gets key value type. Not implemented.

◆ GetValueNames()

ASPOSECPP_SHARED_API System::ArrayPtr<System::String> Microsoft::Win32::RegistryKey::GetValueNames ( )

Gets list of value names under current key.

Returns
List of string names.

◆ OpenBaseKey()

static ASPOSECPP_SHARED_API System::SharedPtr<RegistryKey> Microsoft::Win32::RegistryKey::OpenBaseKey ( RegistryHive  hKey,
RegistryView  view 
)
static

Opens base key. Not implemented.

◆ OpenRemoteBaseKey() [1/2]

static ASPOSECPP_SHARED_API System::SharedPtr<RegistryKey> Microsoft::Win32::RegistryKey::OpenRemoteBaseKey ( RegistryHive  hKey,
const System::String machineName 
)
static

Opens base key on remote host. Not implemented.

◆ OpenRemoteBaseKey() [2/2]

static ASPOSECPP_SHARED_API System::SharedPtr<RegistryKey> Microsoft::Win32::RegistryKey::OpenRemoteBaseKey ( RegistryHive  hKey,
const System::String machineName,
RegistryView  view 
)
static

Opens base key on remote host. Not implemented.

◆ OpenSubKey() [1/4]

ASPOSECPP_SHARED_API System::SharedPtr<RegistryKey> Microsoft::Win32::RegistryKey::OpenSubKey ( const System::String name)

Opens subkey of current key.

Parameters
nameName of the subkey.
Returns
RegistryKey object associated with subkey.

◆ OpenSubKey() [2/4]

ASPOSECPP_SHARED_API System::SharedPtr<RegistryKey> Microsoft::Win32::RegistryKey::OpenSubKey ( const System::String name,
bool  writable 
)

Opens subkey of current key. Not implemented.

◆ OpenSubKey() [3/4]

ASPOSECPP_SHARED_API System::SharedPtr<RegistryKey> Microsoft::Win32::RegistryKey::OpenSubKey ( const System::String name,
RegistryKeyPermissionCheck  permissionCheck 
)

Opens subkey of current key. Not implemented.

◆ OpenSubKey() [4/4]

ASPOSECPP_SHARED_API System::SharedPtr<RegistryKey> Microsoft::Win32::RegistryKey::OpenSubKey ( const System::String name,
RegistryKeyPermissionCheck  permissionCheck,
RegistryRights  rights 
)

Opens subkey of current key. Not implemented.

◆ SetAccessControl()

ASPOSECPP_SHARED_API void Microsoft::Win32::RegistryKey::SetAccessControl ( const System::SharedPtr< RegistrySecurity > &  registrySecurity)

Sets access control value. Not implemented.

◆ SetValue() [1/2]

ASPOSECPP_SHARED_API void Microsoft::Win32::RegistryKey::SetValue ( const System::String name,
const System::SharedPtr< System::Object > &  value 
)

Sets registry value. Not implemented.

◆ SetValue() [2/2]

ASPOSECPP_SHARED_API void Microsoft::Win32::RegistryKey::SetValue ( const System::String name,
const System::SharedPtr< System::Object > &  value,
RegistryValueKind  valueKind 
)

Sets registry value. Not implemented.

◆ ToString()

ASPOSECPP_SHARED_API System::String Microsoft::Win32::RegistryKey::ToString ( ) const
overridevirtual

Converts key to string. Not implemented.

Reimplemented from System::Object.