Re: registry ?


Posted by Martin Jackson on October 29, 2000 at 22:59:00:

In Reply to: registry ? posted by Denis on October 27, 2000 at 21:32:21:

You will need to create a TRegistry object. From there, you have all of the functionality you need for writing keys and values into the registry.

eg.
procedure WriteRegistryValue( aKeyName : String; aValue : String );
var
l_Registry : TRegistry
begin
l_Registry := TRegistry.create;
try
l_Registry.rootkey := HKEY_CURRENT_USER
if l_Registry.openkey( '\Software\super Software\ddddd', True ) then
begin
l_Registry.writestring( 'Key', 'fdgdggnAgh..' );
end;
finally
l_Registry.closekey;
l_Registry.free;
end;
end;

The openkey method takes two parameters. The first is the key name, and the second is a boolean value which specifies whether you want the key to be created if it doesn't exist. The method returns a boolean value which tells you whether the operation was successful or not.

You must remember to free the registry object off when you have finished with it, and you must also include the 'registry' unit in the uses clau se of the unit header.

: How can i make a command thets writes into registry something like [HKEY_CURRENT_USER\Software\super Software\ddddd]
: "Key"="fdgfdggnAghjh/ggjghj/ghj/+8Shc="
: when i press a button.

: And is't posible to convert an litlle program from binnary to sourse code if i know what compiler were used etc.?
: thx fo help




Related Articles and Replies: