Borland C ++ Builder FAQ
The content The last update: 12/12/2008

How to work with the register?

The author: OlegGG
The initial link: - - -

To use class TRegistry (the most simple method).
Example:
#include <registry.hpp> 
...
TRegistry *reg = new TRegistry (KEY_ALL_ACCESS); 
if (reg)//if all ОК 
    { 
    //the necessary root is sampled 
    reg-> RootKey = HKEY_LOCAL_MACHINE;  

    //we open section 
    reg-> OpenKey ("Software \\Sources.RU \\", true);  

    //we delete a key 
    reg-> DeleteValue ("some_key"); 

    //we write down values    
    reg-> WriteString ("anekdots", "http://forum.sources.ru/index.php?showtopic=11"); 

    //we check key presence "vot" 
    if (KeyExists ("vot") == false) 
        { 
        //we swear 
        ShowMessage ("And where vot'а put?"); 
        }

    //we close section 
    reg-> CloseKey (); 
    }

delete reg;