//--------------------------------------------------------------------------- #include #include #pragma hdrstop #include "SplashForm.h" #include "Define.h" #include "common.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" Tsplash *splash; //--------------------------------------------------------------------------- __fastcall Tsplash::Tsplash(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall Tsplash::CreateParams(TCreateParams &Params) { TForm::CreateParams(Params); Params.Style &= ~WS_CAPTION; } //--------------------------------------------------------------------------- void __fastcall Tsplash::FormClose(TObject *Sender, TCloseAction &Action) { Action = caFree; } //--------------------------------------------------------------------------- void __fastcall Tsplash::FormCreate(TObject *Sender) { SetFont(); AnsiString BaseDir = ExtractFileDir(Application->ExeName); TRegIniFile *RegIniFile = NULL; RegIniFile = new TRegIniFile(RegFilename); RegIniFile->RootKey = HKEY_LOCAL_MACHINE; RegIniFile->OpenKey(RegFilename + "\\", true); if (RegIniFile) { BaseDir = RegIniFile->ReadString("Common", "Defaultdir", BaseDir); delete RegIniFile; } imgSplash->Picture->LoadFromFile(BaseDir + "\\splash.bmp"); Height = imgSplash->Picture->Height; Width = imgSplash->Picture->Width; } //--------------------------------------------------------------------------- void __fastcall Tsplash::SetFont(){ SetSmallFont(Font); } //---------------------------------------------------------------------------