procedure TForm1.FormCreate(Sender: TObject);
begin
IdleTimer1.AutoEnabled:=True;
IdleTimer1.AutoEndEvent:=itaOnUserInput;
IdleTimer1.AutoStartEvent:=itaOnIdle;
IdleTimer1.Enabled:=False;
IdleTimer1.Interval:=5000;
end;
procedure TForm1.IdleTimer1Timer(Sender: TObject);
begin
ShowMessage('Application will be closed by inactivity.');
Application.Terminate;
end;
procedure TForm1.FormCreate(Sender : TObject);
begin
IdleTimer1.AutoEnabled:=True;
IdleTimer1.AutoEndEvent:=itaOnUserInput;
IdleTimer1.AutoStartEvent:=itaOnIdle;
IdleTimer1.Enabled:=true;
IdleTimer1.Interval:=5000;
end;
procedure TForm1.IdleTimer1Timer(Sender : TObject);
begin
ShowMessage('Application will be closed by inactivity.');
Application.Terminate;
end;