/*
OnClose example
This example displays a message dialog box when the user attempts to close the form. If the user clicks the Yes button, the form closes; otherwise, the form only minimizes.
*/
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
  if (MessageDlg("Close application ?", mtConfirmation, TMsgDlgButtons() << mbYes << mbNo,0) == mrYes)
    Action = caFree;
  else
    Action = caMinimize;
}
 
