Værdiene "ContactX" i registret er av typen REG_BINARY, som skal konverteres til en string, altså "48 00 65 00 69" -> "H.e.i".
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Registry;
type
TForm1 = class(TForm)
ListBox1: TListBox;
Memo1: TMemo;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
Reg: TRegistry;
TempList: TStringList;
I: Integer;
S: String;
buf: array [0..255] of char;
begin
Reg := TRegistry.Create;
TempList := TStringList.Create;
ListBox1.Clear;
Memo1.Clear;
Reg.RootKey := HKEY_CURRENT_USER;
if Reg.OpenKeyReadOnly('Software\\Microsoft\\MessengerService\\ListCache\\.NET Messenger Service') then
begin
Reg.GetValueNames(TempList);
for I := 0 to TempList.Count - 1 do
begin
S := TempList.Strings[I];
if Pos('Contact', S) > 0 then
begin
S := { binær data fra værdien S konverteres til string };
Memo1.Lines.Add(S);
end;
end;
end;
TempList.Free;
Reg.Free;
end;
end.
Mvh
DiZpel
[Redigeret d. 05/03-04 13:56:01 af DiZpel]