Delphi .NET (2) Database (71) Delphi IDE (90) Network (39) Printing (3) Strings (12) VCL (83) Windows with Delphi (280)
Exchange Links About this site Links to us 
|
Have an animated icon when the form is minimized
This article has not been rated yet. After reading, feel free to leave comments and rate it.
This little sample program uses four TImage components to hold the icons to be used. The icons are changed from a timer.
Since you will not want to have the TImages visible on your screen, you should set their property Visible to false.
In Windows 95/ NT, the animation will appear on the tray as expected.
 | |  | |
const
CurrentState : byte = 1;
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;
InvalidateRect(Application.Handle, nil, True);
if CurrentState >= 4 then
CurrentState := 1
else
inc(CurrentState);
end;
end; | |  | |  |
Comments:
|