Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 01-09-2001, 12:21 PM
Phdr Phdr is offline
Junior Member
 
Join Date: Jan 2001
Posts: 2
Default Registry binary data

How can I retrieve the structure of a registry binary data ?
Reply With Quote
  #2  
Old 01-09-2001, 10:40 PM
douglas douglas is offline
Senior Member
 
Join Date: Jul 2001
Posts: 7,695
Default RE: Registry binary data

This may help you:

Reg.ReadBinaryData('Name', Rec, sizeof(Rec));
Reply With Quote
  #3  
Old 01-09-2001, 10:42 PM
douglas douglas is offline
Senior Member
 
Join Date: Jul 2001
Posts: 7,695
Default More code to look at.

I took this from a newsgroup and was originally posted by Ralph from Team B.

uses
Registry;

procedure TFrmReadBinaryData.Button1Click(Sender: TObject);
const
KeyName: string = 'System\CurrentControlSet\control\TimeZoneInformat ion';
ValName: string = 'DaylightStart';
var
i: integer;
keyGood: boolean;
regKey: TRegistry;
timeInfo: array of byte;
tmpStr: string;
vSize: integer;
begin
regKey := TRegistry.Create;
try
regKey.RootKey := HKEY_LOCAL_MACHINE;
keyGood := regKey.OpenKey(keyName, false);

if (keyGood) then
begin
vSize := regKey.GetDataSize(valName);

if (vSize > 0) then
begin
SetLength(timeInfo, vSize);
regKey.ReadBinaryData(valName, timeInfo[0], vSize);

for i := 0 to vSize - 1 do
tmpStr := tmpStr +
Format('%.2X ', [timeInfo[i]]);

Delete(tmpStr, Length(tmpStr), 1);
Label1.Caption := tmpStr;
end;
end;
finally
regKey.Free;
end;
end;

--
Regards
Ralph (TeamB)
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 09:43 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.