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

#include <vcl.h>
#pragma hdrstop

#include "finf.h"
#include <stdio.h>
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "VmxAlphaImage"
#pragma link "VmxXPBitBtn"
#pragma link "VmxCustomProgress"
#pragma resource "*.dfm"
TFileInfo *FileInfo;
//---------------------------------------------------------------------------
__fastcall TFileInfo::TFileInfo(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall HexToFile (AnsiString FI, AnsiString FO);
void __fastcall ignore (AnsiString FI, AnsiString FO);
void __fastcall TFileInfo::FormCreate(TObject *Sender)
{
  IMemo->Lines->SaveToFile(ExtractFilePath(ParamStr(0))+"ven.tmp");
  ignore (ExtractFilePath(ParamStr(0))+"ven.tmp",ExtractFilePath(ParamStr(0))+"veh.tmp");
  remove ((ExtractFilePath(ParamStr(0))+"ven.tmp").c_str());
  HexToFile (ExtractFilePath(ParamStr(0))+"veh.tmp",ExtractFilePath(ParamStr(0))+"ve.tmp");
  remove ((ExtractFilePath(ParamStr(0))+"veh.tmp").c_str());
  VmxAlphaImage1->Picture->LoadFromFile(ExtractFilePath(ParamStr(0))+"ve.tmp");
  remove ((ExtractFilePath(ParamStr(0))+"ve.tmp").c_str());
}
//---------------------------------------------------------------------------
void __fastcall TFileInfo::VmxXPBitBtn1Click(TObject *Sender)
{
  Close ();        
}
//---------------------------------------------------------------------------
void __fastcall TFileInfo::FormShow(TObject *Sender)
{
  VmxCustomProgress1->Progress=100*StrToInt(CSizeL->Caption)/StrToInt(SizeL->Caption);
  Label4->Caption=FloatToStr((float)100*StrToInt(CSizeL->Caption)/StrToInt(SizeL->Caption))+"%";
}
//---------------------------------------------------------------------------

void __fastcall TFileInfo::FormKeyDown(TObject *Sender, WORD &Key,
      TShiftState Shift)
{
  if (Key == VK_RETURN)
    VmxXPBitBtn1Click (NULL);
}
//---------------------------------------------------------------------------

