Как показать видео на полном экране?

Материал из DRKB


procedure TForm1.Button1Click(Sender: TObject);
const
  LongName: PChar = 'f:\media\ANIM1.MPG'; { Your complete FileName }
var
  ret, ShortName: PChar;
  err: DWord;
begin
  { Getting the short Name (8:3) of selected file }
  ShortName := StrAlloc(521);
  GetShortPathName(LongName, ShortName, 512);
  { Sending a close Command to the MCI }
  ret := StrAlloc(255);
  err := MciSendString(PChar('close movie'), 0, 0, 0);
  { No error check because at the first call there is no MCI device to close }
  { Open a new MCI Device with the selected movie file }
  err := MciSendString(PChar('open ' + ShortName + ' alias movie'), 0, 0, 0);
  ShortName := nil;
  { If an Error was traced then display a MessageBox with the mciError string }
  if err <> 0 then
  begin
    MciGetErrorString(err, ret, 255);
    MessageDlg(ret, mtInformation, [mbOk], 0);
  end;
  { Sending the "play fullscreen command to the Windows MCI }
  err := MciSendString(PChar('play movie fullscreen'), 0, 0, 0);
  { Use the following line instead of the above one if you want to play
    it in screen mode }
  err := MciSendString(PChar('play movie'), 0, 0, 0);
  { If an Error was traced then display a MessageBox with the mciError string }
  if err <> 0 then
  begin
    MciGetErrorString(err, ret, 255);
    MessageDlg(ret, mtInformation, [mbOk], 0);
  end;
  ret := nil;
end;


Source: Взято с Delphi Knowledge Base: http://www.baltsoft.com/
ID: 03806