unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 =
class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
OldTime, TimeDiff: TTime;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage('
ja');
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
if (Now >= (OldTime + TimeDiff))
then
Button1Click(Button1);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
OldTime := Now;
TimeDiff := EncodeTime(0, 20, 0, 0);
end;