Splash screen dies on Windows lazarus / 8-Other ---------------------------------------------------------------------- amead · 2006-01-30 04:30 I am fairly new to Lazarus running 0.9.8Beta on FC3 and 0.9.10 on XP.  I have a little program I've written and I wanted it to have a splash screen.  I found the same Delphi advice in a couple different places which worked after I tweaked it with the ProcessMessages call.  I tried using splashform but I couldn't control the amount of time that the screen stayed on-screen. So, this works great on Linux but on XP it crashes with "Project raised exception class 'Exception' with message: failed to create win32 control, error: 1407" ... the only controls on the splash screen are some TLabels... It runs fine if I move the Application.Initialize to the beginning, right after begin and before I start creating forms. -Alan program sow; {$mode objfpc}{$H+} uses   Interfaces, // this includes the LCL widgetset   Forms,   crt,   splash, main, about; begin   // show the splash screen   FormSplash := TFormSplash.Create(Application);   FormSplash.Show;   FormSplash.Paint;   FormSplash.Update;   Application.ProcessMessages; // allow paint   Application.Initialize;   Delay(2000); //  Application.Initialize;   Application.CreateForm(TFormMain, FormMain);   Application.CreateForm(TformAbout, formAbout);     FormSplash.Hide;   FormSplash.Free;   Application.Run; end. ---------------------------------------------------------------------- Giuseppe Ridinò · 2006-01-30 12:39 Try to use a timer to do it. I use it in my projects (http://dedalu.sourceforge.net) Bye, Pepecito ---------------------------------------------------------------------- Vincent Snijders · 2006-01-30 13:10 With LCL applications, you need to call Application.Initialize before creating any forms. If you want to create the a spalshform, why don't you set the form style to fsSplash. Then the form will automatically closed, when your application enters the Idle state. ---------------------------------------------------------------------- Giuseppe Ridinò · 2006-01-31 13:10 Quote from: "amead"...  I tried using splashform but I couldn't control the amount of time that the screen stayed on-screen. I think that this is the point. One is not able to set a specific amount of time the splash screen should remain. :? For example, if your application goes to idle in half a second you will see the splash screen for half a second, while one may want to see it for a preset 4 seconds. :cry: This is why I don't use the splash form but a custom one with a timer which close the form when a certain time has ellapsed. In addiction to this one should consider also the the possibility the left the splash screen if the application is still not idle. Conclusion There should be two events that close the splash screen: 1) time expire now (with condition "Application is idle") 2) application goes idle (with condition "Time is over") ---------------------------------------------------------------------- Vincent Snijders · 2006-01-31 13:17 Hmm, I always thought the splash screen was to entertain the user will the application started up, not a nag screen to keep the user from getting into its application... ---------------------------------------------------------------------- matthijs · 2006-01-31 16:39 I agree with that, Vincent. But it is also very anoying when the splash screen only comes up and goes away the same instance. I think it is good to let the splash screen be visible for at least 3 seconds or so.