RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TApplication.Minimize Method

Shrinks an application to the Windows task bar.

Pascal
procedure Minimize;
C++
__fastcall Minimize();

Call Minimize to minimize the application. When the user minimizes the application, the Minimize method is automatically called.

Note: Don't confuse the Minimize method, which minimizes an entire application, with minimizing a form or window. To minimize, maximize, or restore a window or form, change the value of its WindowState property.
 

C++ Examples: 

 

/*
The following code minimizes an application when it’s
deactivated. Note that AppDeactivate should be declared a
method of TForm1.  Click anywhere outside of the form
to deactivate it.
*/
void __fastcall TForm1::AppDeactivate(TObject *Sender)
{
  Application->Minimize();
}

void __fastcall TForm1::FormCreate(TObject *Sender)
{
  Application->OnDeactivate = AppDeactivate;
}

 

Delphi Examples: 

{
The following code minimizes an application when it’s
deactivated. Note that AppDeactivate should be declared a
method of TForm1.  Click anywhere outside of the form
to deactivate it.
}
procedure TForm1.FormCreate(Sender: TObject);
begin
  Application.OnDeactivate := AppDeactivate;
end;
procedure TForm1.AppDeactivate(Sender: TObject);
begin
  Application.Minimize;
end; 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!