unit TAnimateActive;

interface

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

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

// BeginExample: TAnimateActive
// Method: ComCtrls.TAnimate.Create
// Property: ComCtrls.TAnimate.Active
// Property: ComCtrls.TAnimate.CommonAVI
// Type: ComCtrls.TCommonAVI

// BeginCode
{
To run this example, create a new project, place a button on
the form, and insert the example code to the button click
event. Place the button on the bottom of the form to leave
room for the TAnimate component that will be created on the
fly.
}
procedure TForm1.Button1Click(Sender: TObject);
var
  TempForm: TForm;
  I: Integer;
begin
  TempForm := TForm.Create(Self);
  with TAnimate.Create(TempForm) do
  try
    Parent := TempForm;
    CommonAVI := aviFindFile;
    Active := True;
    TempForm.Show;
    // Simulate a lengthy process.  Alter this value
    // to accommodate your machine speed.
    for I := 0 to 90000000 do Application.ProcessMessages;
  finally
    TempForm.Release;
  end;
end;
// EndCode
// EndExample: TAnimateActive
end.
