Dann will ich auch noch mal:
Delphi-Quellcode:
uses
Registry;
procedure TForm2.Button1Click(Sender: TObject);
var
Keys: TStringList;
Reg: TRegistry;
i: Integer;
li: TListItem;
begin
Reg := TRegistry.Create(KEY_READ);
Keys := TStringList.Create;
try
try
Reg.RootKey := HKEY_LOCAL_MACHINE;
if Reg.OpenKey('
SOFTWARE\Microsoft\Microsoft Antimalware', False)
then
begin
Reg.GetKeyNames(Keys);
for i := 0
to Keys.Count - 1
do
begin
li := ListView1.Items.Add;
li.Caption := Keys.Strings[i];
end;
end
else
raise Exception.Create('
Schlüssel konnte nmicht geöffnet werden');
except
on E:
Exception do
ShowMessage(E.
Message);
end;
finally
Reg.Free;
Keys.Free;
end;
end;