unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    GroupBox1: TGroupBox;
    cmbFlashOnce: TButton;
    GroupBox2: TGroupBox;
    cmbFlashFor4Sec: TButton;
    cmbInverse10Times: TButton;
    Timer1: TTimer;
    procedure cmbFlashOnceClick(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure cmbFlashFor4SecClick(Sender: TObject);
    procedure cmbInverse10TimesClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.cmbFlashOnceClick(Sender: TObject);
begin
  FlashWindow(Handle, TRUE);
end;

procedure TForm1.cmbFlashFor4SecClick(Sender: TObject);
var
  fl: FLASHWINFO;
begin
  fl.cbSize := SizeOf(fl);
  fl.hwnd := Handle;
  fl.dwTimeout := 200; //Инвертировать каждые 0.2сек
  fl.dwFlags := FLASHW_ALL or FLASHW_TIMER;
  fl.uCount := 0;
  FlashWindowEx(fl);

  Timer1.Enabled := True;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
var
  fl: FLASHWINFO;
begin
  fl.cbSize := SizeOf(fl);
  fl.hwnd := Handle;
  fl.dwFlags := FLASHW_STOP;
  FlashWindowEx(fl);

  Timer1.Enabled := False;
end;

procedure TForm1.cmbInverse10TimesClick(Sender: TObject);
var
  fl: FLASHWINFO;
begin
  fl.cbSize := SizeOf(fl);
  fl.hwnd := Handle;
  fl.dwFlags := FLASHW_ALL;
  fl.uCount := 10;
  fl.dwTimeout := 200;
  FlashWindowEx(fl);
end;

end.
