unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    CheckBox1: TCheckBox;
    CheckBox2: TCheckBox;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    procedure Button3Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure CheckBox2Click(Sender: TObject);
    procedure CheckBox1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.CheckBox1Click(Sender: TObject);
begin
if (CheckBox1.Checked) then
  SetWindowPos(Form1.Handle,HWND_TOPMOST,
               Form1.Left,Form1.Top,Form1.Width,Form1.Height,
               SWP_NOMOVE or SWP_NOSIZE)
  else
  SetWindowPos(Form1.Handle,HWND_NOTOPMOST,
               Form1.Left,Form1.Top,Form1.Width,Form1.Height,
               SWP_NOMOVE or SWP_NOSIZE);
end;

procedure TForm1.CheckBox2Click(Sender: TObject);
begin
if (CheckBox2.Checked) then
  ShowWindow(Application.Handle,SW_HIDE)
  else
  ShowWindow(Application.Handle,SW_SHOW);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
FlashWindow(Application.Handle,True);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
//Beep;
//MessageBeep(MB_OK);
MessageBeep(MB_ICONEXCLAMATION);
end;

procedure TForm1.Button3Click(Sender: TObject);
var i: Cardinal;
begin
//Windows.Beep(100,100);
for i:=1 to 10 do Windows.Beep(100*i,100);
//for i:=10 downto 1 do Windows.Beep(100*i,100);
end;

end.
