unit fmEndless;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, uEndlessThread;

type
  TForm1 = class(TForm)
    ListBox1: TListBox;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

  procedure DoInit;
  procedure DoFinalize;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure DoInit;
var
  iCount : Integer;
begin
  Randomize;
  Form1 := TForm1.Create(nil);
  Form1.Show;
  for iCount := 1 to 100 do    // Iterate
  begin
    Form1.ListBox1.Items.Add(IntToStr(GetCurrentThreadID) + ' : ' + IntToStr(iCount));
    Application.ProcessMessages;
  end;
end;

procedure DoFinalize;
begin
  Form1.Close;
  FreeAndNil(Form1);
end;

end.
