SPECIAL OFFER        Order and save right now!
20% off with the 729824315 dicscount code for Ultimate Pack and any another product for Delphi from Greatis Programming!

⤷ Close application when lose focus

This example shows, how to close application, which is losing focus and becoming deactivated. Use onDeactivate event of TApplication class.

procedure TForm1.CloseApp(Sender: TObject);
begin
  Close;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Application.OnDeactivate:=CloseApp;
end;
More for developers
Databases for Amazon Associates
Amazon Categories
Amazon Nodes