uses Registry;
procedure GetRegInfo(HK: HKey; Key, Value: string; st: TStrings);
var
reg: TRegistry;
i, lg: integer;
buff: string;
p: pchar;
begin
lg := 4096;
setlength(buff, lg);
st.clear;
Reg := TRegistry.Create;
try
Reg.RootKey := HK;
if Reg.OpenKey(key, false)
then try
reg.ReadBinaryData(Value, buff[1], lg);
i := 0;
repeat
p := @buff[1];
st.add(p);
if (i > lg) or (buff[i + 1] = #0) then break;
i := pos(#0, buff);
delete(buff, 1, i);
until false;
except
st.clear;
st.add('FEHLER');
end;
finally
Reg.CloseKey;
Reg.Free;
end;
buff := '';
end;
// Beispielaufruf für Bios-Version
procedure TForm1.Button1Click(Sender: TObject);
begin
GetRegInfo(HKEY_LOCAL_MACHINE, '\HARDWARE\DESCRIPTION\System',
'SystemBiosVersion', Memo1.lines);
end;