Creating a flashing icon

Question:

How can I create a flashing icon?

Answer:

You can call the Windows API function FlashWindow():

Example:

var

  Flash : bool;

 

procedure TForm1.Timer1Timer(Sender: TObject);

begin

  FlashWindow(Form1.Handle, Flash);

  FlashWindow(Application.Handle, Flash);

  Flash := not Flash;

end;

 

procedure TForm1.FormCreate(Sender: TObject);

begin

 Flash := False;

end;