cyprus106
Programmer
- Apr 30, 2001
- 654
I am having the absolute DARNDEST time finding code to create a splash screen in builder!!! I've done search after search and am getting awfully frusterated. Any help??
Cyprus
Cyprus
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
// Run program only once so create a mutex
HANDLE mutex;
try
{
const char mutexname[] = "CostToProduceVeneer";
// See if mutex already exists
mutex = OpenMutex (0, false, mutexname);
if (mutex == NULL)
{
// Mutex is NOT here
// OK to create mutex and run application
mutex = CreateMutex(NULL, true, mutexname);
}
else
{
// Mutex is running so cannot open another instance of program
ShowMessage("Application Already Running");
return 0;
}
Application->Initialize();
// Display splash screen
SplashForm=new TSplashForm(Application);
SplashForm->Show();
SplashForm->Update();
// Done with splash screen
Application->Title = "Cost To Produce Veneer";
Application->CreateForm(__classid(TCTPVmainform), &CTPVmainform);
Application->Run();
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
ReleaseMutex(mutex);
return 0;
}
//---------------------------------------------------------------------------
void __fastcall TSplashForm::SplashTimerTimer(TObject *Sender)
{
Close();
}
//---------------------------------------------------------------------------
void __fastcall TSplashForm::CreateParams(TCreateParams &Params)
{
TForm::CreateParams(Params); // Base
Params.Style &= ~WS_CAPTION; // then remove caption
}
//----------------------------------------------------------------------------
void __fastcall TSplashForm::FormClose(TObject *Sender,
TCloseAction &Action)
{
Action = caFree;
}
//---------------------------------------------------------------------------