Two modules that read and write values in the Windows Registry, enabling persistence of behavior in an application.
Name | Type | Description | |
HKey | String | Root Registry key. | |
KeyName | String | Name of Registry key. | |
ValueName | String | Name of Registry value. | |
Value | String | Actual string to write to Registry. | |
DoIt | Integer | Trigger input that starts reading or writing. | |
Name | Type | Description | |
Value | String | Actual string read from Registry. | |
ValueF | Float | Conversion of Value to a numerical value. | |
ErrorCode | Integer | Error code generated internally by Registry functions. | |
The Windows Registry contains essential system information that is necessary for the operation of a Windows system. If you do not understand the structure of the Registry or appreciate the dangers inherent in editing the Registry then it is recommended that you do not use the modules in this project. Indiscriminate use of these modules is likely to result in damage being caused to the Registry. The International AVS Centre cannot be held liable for any damages resulting from the use of this software.
The Registry modules allow the user to read and write values in the Microsoft Windows Registry. The Windows Registry is the central store for configuration information on all the 32-bit Windows platforms. It is organised into a series of hierarchical tree structures much like directory structures. Three key terms describe a position in the registry.
Hence the Registry contains several HKeys, each of which contain a large number of Keys. In turn each Key can contain a number of Values. These modules allow the user to read from and write to a arbitrarily defined position in the registry. They may be used to add persistent behavior to an application. For example an application could store the path to the last file or directory read in, or critical parameter values that could be restored in a later session. The two modules act as a pair, RegistryRead reads values from the registry, while RegistryWrite writes new values or updates old values.
HKey
Root HKey to be read from or written to. This parameter must be specified. Currently the Windows Registry contains 6 root HKeys, shown below. This string is checked to ensure that it is one of these HKeys.
KeyName
Key to be read from or written to. If no value is provided for this parameter the root key of the specified HKey is used.
ValueName
Value to be read from or written to. If no value is provided for this parameter the default value of the specified key is used.
Value - RegistryWrite only
String value to be written to the Registry. A value must be provided for this parameter.
DoIt
Separate trigger parameter that can be used to start reading from or writing to the registry. The modules are notified of changes to some parameters. However to increase the ease of use of these modules this parameter is provided to allow manual triggering of registry reading or writing.
Value - RegistryRead only
String value read from the registry.
ValueF - RegistryRead only
Conversion of the value read from the registry to numerical format. This output is provided to allow for the easier storage of numerical data in the registry.
ErrorCode
Error code generated internally by the Registry functions. If the functions completed successfully this parameter will have a value of zero. Normally this output will only be used if the error messages given by the module itself are not sufficient.
An example application, RegistryEg, is provided that creates a RegistryRead and a RegistryWrite module. The user can then use these modules to read values from and write values to the registry.
iac_proj/registry/reg_mods.v contains the V definitions of the RegistryRead and RegistryWrite modules.
iac_proj/registry/reg_macs.v contains the V definition of the RegistryEg example application.
The Windows Registry is a very powerful store of information. However it is complicated to use and vulnerable to damage caused by incorrectly written software. If you use these modules you should make yourself familiar with the relevant registry documentation. This is available form the Microsoft Developer's Network.
These modules only work on the Windows platforms. The do not work on UNIX platforms. The modules are not defined on UNIX platforms.
The low-level RegistryMods library containing the low-level modules does not specify a process. By default the express process will be used.
Mark Ward, Advanced Visual Systems, Inc. Andrew Dodd, International AVS Centre.
International AVS Centre Manchester Visualization Centre Manchester Computing University of Manchester Oxford Road Manchester United Kingdom M13 9PL
n/a