AR Registry Access ActiveX Library 1.0

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

History:

This library contains three 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.

Only REG_DWORD and REG_SZ type values (long and string types) are fully supported. This is all I have needed till now.

The objects included in this library are:

clsKey clsKeys
Properties:
  • Exists. True if the specifies key exists.
  • 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.
Properties:
  • Count. Number of subkeys in the object.
  • 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:
  • Refresh. This method will force the library to re-read the contents of the specified 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.
  • Refresh. This method will force the library to re-read the contents of the specified parent key.

 

clsValues clsValue
Properties:
  • Count. Number of values that the parent key contains.
  • 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.
Properties:
  • Name. Name of the value.
  • Value. Content of the value.
  • ValueType. Right now it can only be REG_DWORD (long) or REG_SZ (string).
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 may only be REG_DWORD (long) or REG_SZ (string). Returns True if successful.
  • Delete (ValueName). This method will remove the value specified in ValueName. Returns True if successful.
  • Refresh. This method will force the library to re-read the contents of the specified parent key.
 

 

(15 Kb)

 

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