Hello everybody! In this 'Quick Tips' we will create a routine to log information in the Windows registry. For this we have the class “TRegIniFile” in Delphi which is in the Registry Unit. Initially we will create one Unit and save as “uRegister.pas”. Dec 2, 2002 - I am trying to save a registry key in Delphi, with all subkeys and values to a file. The file is created but it is empty. I use Delphi 5 Enterprise.
SELECT OrderNo, CustNo, SaleDate, EmpNo, ShipVIA, Terms, ItemsTotal, TaxRate, Freight, AmountPaid FROM 'orders.db' Orders where ItemsTotal 15000 First we have to prepare the excel layout. Open Excel, go to Tools - Macro - Record new macro We will: 1) prepare the header with the column names 2) apply bold font, and centering 3) Fill in 2 rows of data 4) Apply the 4-mar-97 date format 5) Apply percent format 6) Apply $10,000.00 format to 3 columns 7) Use Autoformat to give some nice colors to the table 8) Show all columns with autofit Just record the macro by typing in all the necessary stuf and formating etc. After that you use the macro editor to make the commands made visible. It should look like this.
Using VB6, I wish to come up with some solution that.will let me grab from the registry all the subkeys and values belonging to a target key, and export them as a standard REG file that can at a later time be merged (default double click) back into the registry. STANDARD REGFILE! SAME FORMAT, same merge-entry format.
![Export registry settings Export registry settings](http://www.delphisources.ru/pages/faq/master-delphi-7/content/images/fig01_01_0.jpg)
I have a fair bit of code for manipulating individual registry entries anywhere in the reg, but for this question, I don't care one bit whatsoever what those values are - I want an interface to automate the manual process of exporting a whole key branch from Regedit into a REG file. Presume that I wish to grab all the REG entries out of a particular key, all subkeys and values, on a highly frequent basis, as a backup. The target key may or may not have a constant set of registry keys, and many of the keys may have one or many keys that have dynamically produced names. Hence the need to enumerate subkeys at the time of action rather than work from a set of constant names. Having the program export a standard REG file will also allow for me to rapidly restore keys and key structure for any specific time I want. Presume that the application I have in mind will be recording state-specific information in the registry so that I could have a library of dozens of such files, and with a point and click, convert the state of the program to that which I desire at any given moment. Also presume that the keys I wish to work on are not for my own program, but belong to a different system, so I have no control over them.
Bottom line: What I can do manually - launch regedit, expand HKCU Software SumKompany, choose to export that and all subkeys, provide a filename, and press enter to wind up with a REG file - I want to do programmatically. PLEASE: NO ALTERNATE THEORETICAL DESIGN PREMISES, NO 'WHAT ABOUT STORING YOUR DATA A DIFFERENT WAY LIKE THIS.' , NO 'HOW ABOUT READING ALL THE KEYS AND SUBKEYS THEN PRINTING THEM OUT USING THE REGEDIT FORMAT STYLE'. Well, that last one maybe - if the answer is 'Here is a link or some code that will enumerate all the unknown keys and values from a given registry key and print out their names and values. Perhaps you can intercept the data and reformat it to the desired output' and not 'How about reading all the keys and subkeys then printing them out using the regedit format style?'