unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 =
class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormClose(Sender: TObject;
var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
vAbbruch : boolean;
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
close;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
repeat
beep;
Application.ProcessMessages;
until (1000<1)
or vAbbruch;
end;
procedure TForm1.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
vAbbruch:=true;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
vAbbruch:=false;
end;
end.