Hello Darek
2 - First create a form with a TImage to display the picture of your splash.
Then at then begining of your script, declare as variable a TTimer (call it Timer1 - Call it so you can use another timer if you want display time and date with a Timer 2)
Then between BEGIN and END. (at the end of your script), place this pied of code :
Timer1 := TTimer.Create(nil); // Creation of the Timer
Timer1.OnTimer := @OnTimer2; // Procedure of the event
Timer1.Interval := 4000; // 4 sec
Timer1.Enabled := True; // Lauching of Timer
Splash.ShowModal; // Displaying splash
At last, create this procedure to release the timer :
procedure OnTimer1(Sender: TObject); // Procedure to close the Splash after 4 sec
begin
Timer1.Enabled := False;
Splash.Close;
Timer1.Free;
end;
9 - Using a trial version :
This code :
procedure Form1_OnShow (Sender: string; Action: string);
var
reg: TRegistry;
iDays: integer;
begin
reg := TRegistry.Create;
reg.Access := KEY_ALL_ACCESS;
reg.RootKey := HKEY_CURRENT_USER;
reg.OpenKey('software\MyVisualDatabaseTrial',true);
if not reg.ValueExists('StartDate') then reg.WriteDate('StartDate', Now+30); // trial period is 30 days
iDays := Trunc(reg.ReadDate('StartDate')) - Trunc(Now); // time left days
reg.CloseKey;
reg.Free;
if iDays < 1 then
begin
if MessageDlg('Trial period is over.'+#13+' Do you want to visit a order page?', mtInformation, mbYes+mbNo, 0) = mrYes
then OpenUrl('http://yourpage.com');
Form1.Close;
Exit;
end;
if MessageDlg('Demo version. Time left: ' + IntToStr(iDays) +' days.'+#13+'Do you want to visit a order page?', mtInformation, mbYes+mbNo, 0) = mrYes
then OpenUrl('http://yourpage.com');
end;
8 - Read a video file :
procedure Form1_Button5_OnClick (Sender: string; var Cancel: boolean);
begin
MediaPlayer.FileName := 'c:\oiseaux_new\videos\bruant jaune.mp4'; // Place here your own video file
MediaPlayer.Open;
MediaPlayer.Display := Form1.Panel1;
MediaPlayer.DisplayRect(0, 0, Form1.Panel1.Width, Form1.Panel1.Height);
MediaPlayer.Play;
end;
procedure Form1_Button2_OnClick (Sender: string; var Cancel: boolean);
begin
MediaPlayer.Stop;
end;
procedure Form1_Button1_OnClick (Sender: string; var Cancel: boolean);
begin
MediaPlayer.Pause;
end;
Si on veut lire le fichier en boucle
procedure MediaPlayer_OnNotify (Sender: string);
begin
if MediaPlayer.NotifyValue=nvSuccessful then
begin
//restart the song
MediaPlayer.Play;
MediaPlayer.Notify := True;//ensures we are notified when song completes
end;
end;
I hope this can help you darek
No hesitation if any problem with those pieces of code
JB