procedure TForm1.FormCreate(Sender: TObject);
begin
Form1.Left:=(Form1.Monitor.WorkAreaRect.Width-Form1.Width) div 2; // approximate centre of screen, ignores title bar height
Form1.Top:=(Form1.Monitor.WorkAreaRect.Height-Form1.Height) div 2; // and side border widths, but is the best we can do.
AlphaBlendValue:=0; // start up invisible, Timer1 handler
AlphaBlend:=true // fades in over approximately 225ms (comment out for testing)
end;
procedure TForm1.Timer1Timer(Sender: TObject); // (15ms timer event)
const startup:boolean=true;
holdoff:integer=-90;
begin
if startup then // startup with AlphaBlend=true, slow fade in after holdoff
begin
if holdoff<0 then inc(holdoff, Timer1.Interval)
else AlphaBlendValue:=min(AlphaBlendValue+17, 255);
if AlphaBlendValue=255 then
begin
AlphaBlend:=false; // at 100% visibility turn off AlphaBlend
startup:=false // set end of startup flag, never end up here again
end
end
end;