//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Minimize.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
// BeginExample: Minimize
// Method: Forms.TApplication.Minimize
// Event: Forms.TApplication.OnDeactivate

// BeginCode
/*
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;
}
// EndCode
// EndExample: Minimize
//---------------------------------------------------------------------------
