A: Note: this code does not work with Win95. It uses four TImage components to hold the icons to be used. The icons are changed from a timer.
{CurrentState is a byte that knows which icon is currently displayed. It is initialized in the form's OnCreate() method.}
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if IsIconic(Application.Handle) then
Begin
case CurrentState Of
1: Application.Icon := Image1.Picture.Icon;
2: Application.Icon := Image2.Picture.Icon;
3: Application.Icon := Image3.Picture.Icon;
4: Application.Icon := Image4.Picture.Icon;
end;{case}
InvalidateRect(Application.Handle, nil, True);
{This is critical!}
inc(CurrentState);
if CurrentState > 4 then
CurrentState := 1;
End;
end;