Re: REG_BINARY



Works OK for me - I put this binary data int
HKCU\Software\AGLTest\GameScore and retrieved it with ...

procedure TForm1.Button1Click(Sender: TObject);
var
Reg : TRegistry;
GSByte : array[0..7] of byte;
GSWord : array[0..3] of word absolute GSByte; // overlays GSByte in
memory
GSDWord : array[0..1] of DWord absolute GSByte; // overlays GSByte
in memory
begin
Reg := TRegistry.Create;
with Reg do begin
RootKey := HKEY_CURRENT_USER;
if OpenKey('Software\AGLTest', false) then begin
ReadBinaryData('GameScore', GSByte, SizeOf(GSByte));
Label1.Caption := Format('$%8.8x, $%8.8x', [GSDWord[0],
GSDWord[1]]) + #13 +
Format('$%4.4x, $%4.4x, $%4.4x, $%4.4x',
[GSWord[0], GSWord[1], GSWord[2],
GSword[3]]) + #13 +
Format('$%2.2x, $%2.2x, $%2.2x, $%2.2x,
$%2.2x, $%2.2x, $%2.2x, $%2.2x',
[GSByte[0], GSByte[1], GSByte[2],
GSByte[3],
GSByte[4], GSByte[5], GSByte[6],
GSByte[7]]);

end; {if OpenKey('Software\AGLTest', false)}
Free;
end; {with Reg}
end;

.... displaying it a two DWords, 4 Words oand 8 bytes.

Alan Lloyd

.