unit SyncForm;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ExtCtrls, StdCtrls, ChecksumList, CheckThread;

type
  TForm1 = class(TForm)
    FileMemo: TMemo;
    Timer1: TTimer;
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
  private
    { Private declarations }
    FChecksumList: TChecksumList;
    FCheckThread: TCheckThread;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
begin
  FChecksumList := TChecksumList.Create;
  FCheckThread := TCheckThread.Create(true);
  with FCheckThread do
  begin
    StartDir := 'D:\Netscape Profiles\Martin\News\host-newsgroups.borland.com\';
    CheckList := FChecksumList;
    Resume;
  end;
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
  with FCheckThread do
  begin
    Terminate;
    WaitFor;
    Free;
  end;
  FChecksumList.Free;
end;

procedure TForm1.Timer1Timer(Sender: TObject);

var
  TempList: TStringList;

begin
  TempList := FChecksumList.GetChecksumList;
  with FileMemo do
  begin
    with Lines do
    begin
      BeginUpdate;
      Assign(TempList);
      EndUpdate;
    end;
    selstart := gettextlen;
    perform(em_scrollcaret, 0, 0);
  end;
  TempList.Free;
end;

end.