Unit AlbReg

Classes

TRegIniFile1 - Similar to modify_registry_values, but simpler parameters: Only one condition is allowed.

Functions

modify_registry_value - Similar to read_registry_values, but simpler parameters: Only one condition is allowed.
modify_registry_values - Reads Values in Registry.
read_registry_value - Looks in the registry and modifies all fitting variables to the value.
read_registry_values - Test conditions

Types

RootKeys

Constants

Variables


Functions


procedure modify_registry_value(root:RootKeys; keys,variable,newvalue:string; condition:String);

Similar to read_registry_values, but simpler parameters: Only one condition is allowed. (If no condition, use ''). The result is only the first found value

procedure modify_registry_values(root:RootKeys; keys,variable,newvalue:string; conditions:TStringList);

Reads Values in Registry. If variable='' then results all fitting keys} {Root: one of HKey_Classes_Root, HKey_Current_Config, HKey_Current_User, HKey_Dyn_Data, HKey_Local_Machine, or HKey_Users Keys: Full path before Variable name (example: 'enum\scsi\*\*') You may use * and ? as Wildcards (enum\*or* -> Enum\Network and Enum\Monitor) Variable: Name of Entry. (examples: 'CurrentDriveLetterAssignment' 'AutoInsertNotification') Conditions: StringList of numerical/string Comparisons 'variable=number' or 'variable<>number' or 'variable=string' or 'variable<>string' or 'variable=' (Test on non-existence) or 'variable<>' (Test on existence with any value) (example: 'class=DiskDrive') The two StringLists must be created and detroyed by the user. See the following example: letters:=TStringList.create; try conditions:=TStringList.create; try conditions.add('class=DiskDrive'); read_registry_values(HKey_Local_Machine,'enum\esdi\*\*','CurrentDriveLetterAssignment', conditions,letters); // The result is line after line in the StringList letters with letters do for i:=0 to count-1 do memo1.lines.add('Found Disk Drive '+strings[i]+':') finally conditions.free end; finally letters.free end; // Now you can see your IDE drive letters in the StringList letters // Remark: The registry uses to hold multiple entries of drives

function read_registry_value(root:RootKeys; keys,variable:string; condition:string):string;

Looks in the registry and modifies all fitting variables to the value. The variable MUST exist. For security try first read_registry_values or the LookReg demo, that the correct variables are modified!

procedure read_registry_values(root:RootKeys; keys,variable:string; VAR conditions,result:TStringList);

Test conditions

Types


RootKeys = HKEY_CLASSES_ROOT..HKEY_DYN_DATA
Albrecht Mengel, 13.9.96, mengel@stat-econ.uni-kiel.de USAGE: - Just copy the file into a directory in the delphi path, or set the path in the project options to it. - Then add AlbReg to the USES list in your program. - There are two procedures to search and alter registry values: read_registry_value and modify_registry_value. PROBLEMS: - Not all types of Registry Variables are implemented. In this case occurs an error message. Please send me the call to the function with its parameters. I'll instantly try to implement it (if I find the same registry entry as you have Ideas (not yet implemented): - Allow wildcards in the variable - Results Variables when key is proper and variable='' No Warranty !!!!!!!! Any use of AlbReg is on your own risk!!!!!!!! Please look in AlbReg.txt for more information!

Constants


Variables