Seltsam...
Ich habe folgenden Code:
Delphi-Quellcode:
begin
FSplash := TFSplash.Create(Application);
try
FSplash.Show;
FSplash.Refresh;
Application.Initialize;
Application.Title := '
TrackMania IPC';
Application.CreateForm(TFForm, FForm);
Application.CreateForm(TForm1, Form1);
finally
FSplash.InitializationDone := True;
end;
Application.Run;
FForm.Visible := false;
end.
Splash:
Delphi-Quellcode:
procedure TFSplash.Show;
var i : Integer;
begin
inherited;
for i := 0 to 255 do begin
AlphaBlendValue := i;
Application.ProcessMessages;
Sleep(2);
end;
end;
procedure TFSplash.FormClose(Sender: TObject; var Action: TCloseAction);
var i : Integer;
begin
for i := 255 downto 0 do begin
AlphaBlendValue := i;
Application.ProcessMessages;
Sleep(2);
end;
Action := caFree;
UIPC.FForm.Enabled := true;
FSplash := nil;
end;
procedure TFSplash.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
CanClose := (not Timer.Enabled) and FInitializationDone;
end;
procedure TFSplash.SetInitializationDone(const Value: Boolean);
begin
FInitializationDone := Value;
Close;
end;
procedure TFSplash.TimerTimer(Sender: TObject);
begin
Timer.Enabled := False;
Close;
end;
end.
Ich habe außer dort beim Fade KEIN Sleep.