ISDBRegistry::OpenKey

From MediaMonkey Wiki
Jump to navigation Jump to search

CoClass SDBRegistry, Interface ISDBRegistry

Function OpenKey(Key As String, CanCreate As Boolean) As Boolean


Parameters

Name Type Description
Key String Key to be openned.
CanCreate Boolean Whether the key can be created in case it doesn't exist.


Method description

Opens a key so that it can be subsequently used to get/set its values.

Key can either contain a full path starting with '\' (e.g. \Software\Microsoft\Windows\) or only part of path (e.g. 'My Value'). In the second case \Software\Songs-DB\Scripts\ is used as a base key.

Example code

Set Regs = SDB.Registry
If Regs.OpenKey( "Some key", False) Then
  MyValue = Regs.StringValue("Some value")
  Regs.CloseKey
End If