Zitat von
Luckie:
Fehlerbehandlung fehlt komplett
Code:
procedure TForm1.Button1Click(Sender: TObject);
var someLines : TStringList;
begin
someLines:= TStringList.Create;
[b]try[/b]
with TRegistry.create(KEY_READ) do
[color=#ff0022]begin[/color]
[b]try[/b]
Rootkey:=HKEY_LOCAL_MACHINE;
OpenKey('Software', false);
getKeyNames(someLines);
closekey;
[b]finally[/b]
free;
[b]end; [/b]
[color=#ff0000] end;[/color]
Memo1.Lines.Assign(someLines);
[b]finally[/b]
someLines.Free;
[b]end;[/b]
end;
Hi Luckie, die roten Zeilen kannst Du Dir sparen