AR Registry Access ActiveX Library 1.05.0001

This library allows you to fully access the Windows registry in an object-oriented way.

History:

This library contains a few classes clases that you can directly use. With clsValues you can access all the values under a key. With clsKeys you can access all subkeys under a key, and their subkeys and values. With clsKey you can access both subkeys and values. Tipically you will always want to use this object, and access the other two from this one, but in some other situation in which you only want to access values under a certain key, you can directly use the clsValues object, for example.

Only REG_DWORD, REG_SZ, REG_MULTI_SZ and REG_BINARY types are fully supported.

The objects included in this library are:

clsKey
Properties:
  • Exists. True if the specifies key exists.
  • FullPath. Here you can set the full path of the key, in the form "HKLM\Software" or "HKEY_LOCAL_MACHINE\Software".
  • HKEY. Set to HKEY_CLASSES_ROOT, HKEY_CURRENT_CONFIG, HKEY_CURRENT_USER, HKEY_DYN_DATA, HKEY_LOCAL_MACHINE or HKEY_USERS.
  • Name. This property will contain tha name (extracted from the path) of the specified key.
  • Path. Set here the full path (without containing the initial HKEY_whatever) of the key. Something like "SOFTWARE\Microsoft".
  • SubKeys. This will take you to a clsKeys object, that contains the subkeys of the current key.
  • Values. This property will take you to a clsValues object, that contains the values in the current key.
Methods:
  • Delete. This method will delete the present key, all of its values and all of its subkeys. Returns True if successful.
  • Export (strFileName, [OverWrite]). Use this method to export the contents of the current key (values and subkeys) to a file.
  • Refresh. This method will force the library to re-read the contents of the specified key.
  • Restore (strFileName). With this method you can import data previusly saved with the Export method. The contents of the current key will be completely erased, and replaced by the data in the file.
clsKeys
Properties:
  • Count. Number of subkeys in the object.
  • FullPath. Here you can set the full path of the parent key, in the form "HKLM\Software" or "HKEY_LOCAL_MACHINE\Software".
  • HKEY. Initial HKEY_whatever of the parent key.
  • Item (Index). Index may be a number or a name of one of the subkeys. This property will take you to a clsKey object containing subkeys and values for the specified subkey.
  • KeyExists (KeyName). Pass the name of a subkey as KeyName, and the property will return True if that subkey exists among the subkeys of the parent key, or False if it doesn't.
  • Path. Full path of the parent key.
Methods:
  • Add (KeyName). This method will add a new subkeys to the parent key, with the name specified in KeyName. It will return True if succesful.
  • Delete (KeyName). This method will remove the specified subkey, and all of its subkeys (under any operating system). The method will return True if successful.
  • DeleteAll. This method will delete all of the keys under the parent key. Returns True if successful.
  • Refresh. This method will force the library to re-read the contents of the specified parent key.

 

clsValue
Properties:
  • Name. Name of the value.
  • Value. Content of the value. If ValueType is REG_DWORD, this will be a Long type. If ValueType is REG_SZ, this will be a String type. If ValueType is REG_BINARY, this will be an Array. If ValueType is REG_MULTI_SZ, this will be a clsREG_MULTI_SZ object.
  • ValueType. Right now it can only be REG_DWORD (long), REG_SZ (string), REG_MULTI_SZ or REG_BINARY.

 

clsREG_MULTI_SZ
Properties:
  • Count. Number of item in this collection.
  • Item (Index as Long) as String. Returns the string the is in the position Index of the collection.
  • Source as String. This is how data is saved in the registry: strings are separated by null chars and ended by a double null char.
Methods:
  • Add (strCad as String). Adds a new string to the collection.
  • Remove (lIndex as Long). Removes a string from the collection and returns True if successful.
 
clsValues
Properties:
  • Count. Number of values that the parent key contains.
  • FullPath. Here you can set the full path of the parent key, in the form "HKLM\Software" or "HKEY_LOCAL_MACHINE\Software".
  • HKEY. Initial HKEY_whatever of the parent key.
  • Item (Index). Index may be a number or a name of one of the values. It will take to a clsValue object.
  • Path. Full path of the parent key.
  • ValueExists (ValueName). This property will check if a value with the name specified in ValueName exists among the values of the parent key.
Methods:
  • Add (ValueName, Value, ValueType). This method will add a value to the current parent key or update an existing one, with the name specified in ValueName and the value contained in Value. The type of value must be set in ValueType, which right now may only be REG_DWORD (long), REG_SZ (string), REG_MULTI_SZ (multi-string) or REG_BINARY (binary array). Returns True if successful.
  • Delete (ValueName). This method will remove the value specified in ValueName. Returns True if successful.
  • DeleteAll. This method will erase all the values in this path.
  • Refresh. This method will force the library to re-read the contents of the specified parent key.

 

(29 Kb)

 

Alvaro Redondo, 1998. All Rights Reserved.
http://www.sevillaonline.com/ActiveX/