Código
=>Assim não funciona:
function LeReg(root: HKey; key, field: string): string;
=>Assim funciona:
function LeReg(const root: HKey; const key, field: string): string;
Exemplo da função:
function LerRegString(const Root: HKey; const key, campo:string): string;
var Reg: TRegistry;
begin
Reg := TRegistry.Create;
try
reg.rootKey := root;
result := '';
if Reg.OpenKey(Key, false) then
result := Reg.ReadString(campo);
finally
Reg := nil;
Reg.Free;
end;
end;
Planeta Delphi - www.planetadelphi.com.br - Todos os direitos reservados | Copyright 2001-2009