Application.ProcessMessages;
Application.CreateForm(TForm1, Form1);
Label2.text:='Form1 Created';
Application.ProcessMessages;
Application.CreateForm(TForm2, Form2);
Label2.text:='Form2 Created';
Application.ProcessMessages;
Application.MainForm:=Form1;
Form1.Show;
SplashForm.Hide;
SplashForm.Release;
Можно заменить на
tthread.CreateAnonymousThread(procedure
begin
sleep(1000);
tthread.Synchronize(tthread.CurrentThread, procedure
begin
Application.CreateForm(TForm1, Form1);
end);
while not assigned(form1) do
sleep(0);
tthread.Synchronize(tthread.CurrentThread, procedure
begin
Label2.text:='Form1 Created';
end);
sleep(200);
tthread.Synchronize(tthread.CurrentThread, procedure
begin
Application.CreateForm(TForm2, Form2);
end);
while not assigned(form2) do
sleep(0);
tthread.Synchronize(tthread.CurrentThread, procedure
begin
Label2.text:='Form2 Created';
Application.MainForm:=Form1;
Form1.Show;
SplashForm.Hide;
SplashForm.DisposeOf;
end);
end).Start;
но как было сказано выше, использование Sleep не лучший вариант.