游子日月长

笑渐不闻声渐悄,多情却被无情恼!

导航

全屏幕显示AVI

uses Unit2;

procedure TForm1.Button1Click(Sender: TObject);
begin
  Form2.Show;
  Form2.WindowState := wsMaximized;
  Form2.MediaPlayer1.Notify := false;
  Form2.MediaPlayer1.Display := Form2.Panel1;
  Form2.MediaPlayer1.FileName := 'C:\TheWall\DELCAR2.AVI';
  Form2.MediaPlayer1.Open;
  Form2.MediaPlayer1.DisplayRect := Form2.ClientRect;
  Form2.MediaPlayer1.Play;
end;

{Code for Form 2}

procedure TForm2.MediaPlayer1Notify(Sender: TObject);
begin
  if MediaPlayer1.NotifyValue = nvSuccessful then
    Form2.Close;
end;
//////////////////////////////////////////////////////

  public
    { Public-Deklarationen }
    procedure MMNotify(var Message: TMessage); message MM_MCINOTIFY;
  end;

var
  Form1 : TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
  mciSendString('open j:\video.avi alias film', nil, 0, 0);
  mciSendString('window film handle 0', nil, 0, 0);
  mciSendString('window film state show maximized', nil, 0, 0);
  mciSendString('play film notify', nil, 0, Form1.Handle);
end;

procedure TForm1.MMNotify(var Message: TMessage);
begin
  mciSendString('close film', nil, 0, 0);
end;

posted on 2017-02-07 16:22  游子日月长  阅读(104)  评论(0编辑  收藏  举报