Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2004-05

Accessing the registry

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Matthews

I would like to access the registry, but cannot figure out how to get anywhere with it. I am currently using the 1.0.10 compiler on win32 and have been unable to find any documentation for the Registry unit that was shipped with fpc. Any suggestions or pointers to documentation, examples, or other units, etc. would be greatly appreciated.

-Lukas

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.675 / Virus Database: 437 - Release Date: 02-May-04

Reply by email

Matt Emson
to Matthews
I would like to access the registry, but cannot figure out how to get anywhere with it.

If it uses a class similar to Delphi's :

var
  Reg: TRegistry;
begin
  Reg := TRegistry.Create;
  try
    Reg.RootKey := HKEY_CURRENT_USER;
    if Reg.OpenKey('\Software\Microsoft\Windows\CurrentVersion\RunOnce',
True)
    then Reg.WriteString('MyApp','"' + ParamStr(0) + '"');
  finally
    Reg.CloseKey;
    Reg.Free;
  end;
end;

This is pasted from the Delphi 5 helpfile.

Reply by email