MinimizeExample (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

Description

The following code minimizes an application when it is deactivated. Note that AppDeactivate should be declared a method of TForm1. Click anywhere outside of the form to deactivate it.

Code

procedure TForm1.FormCreate(Sender: TObject);
begin
  Application.OnDeactivate := AppDeactivate;
end;
procedure TForm1.AppDeactivate(Sender: TObject);
begin
  Application.Minimize;
end;

Uses