ShowSaveDlg example for C++ Builder

void __fastcall TForm1::ShowSaveDlg1Click(TObject *Sender)
{
   L_INT nRet; 
   AnsiString strMsg; 

   LEADDlgFile1->DialogTitle = "Save a File";
   LEADDlgFile1->MaxFileSize = 0; 
   LEADDlgFile1->MaxFileTitleSize = 0; 
   LEADDlgFile1->DlgFileFlags = 0; 
   LEADDlgFile1->InitialDir = "C:\\";         
   LEADDlgFile1->SaveMulti = MULTIPAGE_OPERATION_OVERWRITE; 
   LEADDlgFile1->DlgFlags = DLG_SAVE_AUTOPROCESS +
                           DLG_SAVE_SHOW_FILEOPTIONS_PROGRESSIVE     +
                           DLG_SAVE_SHOW_FILEOPTIONS_MULTIPAGE       +
                           DLG_SAVE_SHOW_FILEOPTIONS_STAMP           +
                           DLG_SAVE_SHOW_FILEOPTIONS_QFACTOR         +
                           DLG_SAVE_SHOW_FILEOPTIONS_J2KOPTIONS      +
                           DLG_SAVE_SHOW_FILEOPTIONS_BASICJ2KOPTIONS; 
   LEADDlgFile1->LEADImage = LEADImage1; 
   nRet= LEADDlgFile1->ShowSaveDlg ( this ); 
   if ( nRet == SUCCESS_DLG_OK ) 
   {
      strMsg= "FileName: " + LEADDlgFile1->FileName +"\n";
      strMsg= strMsg + "FileTitle: " + LEADDlgFile1->FileTitle +"\n";
      strMsg= strMsg + "SaveBitsPerPixel: " + IntToStr(LEADDlgFile1->SaveBitsPerPixel)+"\n";
      strMsg= strMsg + "SaveFormat: " + IntToStr(LEADDlgFile1->SaveFormat)+"\n";
      strMsg= strMsg + "PageNumber: " + IntToStr(LEADDlgFile1->PageNumber)+"\n";
      strMsg= strMsg + "SaveQFactor: " + IntToStr(LEADDlgFile1->SaveQFactor)+"\n";
      strMsg= strMsg + "SaveMulti: " + IntToStr(LEADDlgFile1->SaveMulti)+"\n";
      strMsg= strMsg + "SavePasses: " + IntToStr(LEADDlgFile1->SavePasses)+"\n";
      strMsg= strMsg + "SaveWithStamp: ";
      if ( LEADDlgFile1->SaveWithStamp ) 
         strMsg= strMsg + "True"+"\n";
      else
         strMsg= strMsg + "False"+"\n";
      strMsg= strMsg + "SaveStampBits: " + IntToStr(LEADDlgFile1->SaveStampBits)+"\n";
      strMsg= strMsg + "SaveStampWidth: " + IntToStr(LEADDlgFile1->SaveStampWidth)+"\n";
      strMsg= strMsg + "SaveStampHeight: " + IntToStr(LEADDlgFile1->SaveStampHeight)+"\n";
      strMsg= strMsg + "SaveInterlaced: ";
      if ( LEADDlgFile1->SaveInterlaced  ) 
         strMsg= strMsg + "True";
      else
         strMsg= strMsg + "False";

      ShowMessage(strMsg); 
   }
}