Subversion Repositories recyclebinunit

Rev

Rev 17 | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. unit Main;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  7.   Dialogs, StdCtrls, registry, ExtCtrls;
  8.  
  9. type
  10.   TMainForm = class(TForm)
  11.     Memo1: TMemo;
  12.     Timer1: TTimer;
  13.     Memo2: TMemo;
  14.     Splitter1: TSplitter;
  15.     procedure Timer1Timer(Sender: TObject);
  16.   private
  17.     procedure GetDump;
  18.   end;
  19.  
  20. var
  21.   MainForm: TMainForm;
  22.  
  23. implementation
  24.  
  25. {$R *.dfm}
  26.  
  27. uses
  28.   Functions;
  29.  
  30. procedure TMainForm.GetDump;
  31. var
  32.   reg: tregistry;
  33.   i: integer;
  34.   oldr, r: string;
  35.   lw: char;
  36. begin
  37.   reg := tregistry.create;
  38.   try
  39.     reg.RootKey := HKEY_LOCAL_MACHINE;
  40.     if reg.OpenKeyReadOnly('SOFTWARE\Microsoft\Windows\CurrentVersion\explorer\BitBucket') then
  41.     begin
  42.       oldr := memo1.text;
  43.  
  44.       if reg.ValueExists('PurgeInfo') then
  45.         r := 'PurgeInfo = ' + BinaryStringToHexDump(RegistryReadDump(reg, 'PurgeInfo'))
  46.       else
  47.         r := 'No PurgeInfo';
  48.  
  49.       for lw := 'A' to 'Z' do
  50.       begin
  51.         if reg.ValueExists(lw) then
  52.         begin
  53.           r := r + #13#10#13#10 + lw + ' = ' + BinaryStringToHexDump(RegistryReadDump(reg, lw));
  54.         end;
  55.       end;
  56.  
  57.       if oldr <> '' then
  58.       begin
  59.         for i := 1 to length(oldr) do
  60.         begin
  61.           if oldr[i] <> r[i] then
  62.             memo2.Lines.Add(inttostr(i)+': '+oldr[i]+' -> '+r[i]);
  63.         end;
  64.       end;
  65.  
  66.       memo1.Text := r;
  67.      
  68.       reg.CloseKey;
  69.     end;
  70.   finally
  71.     reg.free;
  72.   end;
  73. end;
  74.  
  75. procedure TMainForm.Timer1Timer(Sender: TObject);
  76. begin
  77.   GetDump;
  78. end;
  79.  
  80. end.
  81.