[Lazarus] Embedded VLC using PasLibVlc - how to fast forward?

Bo Berglund bo.berglund at gmail.com
Mon Mar 23 19:17:07 CET 2020

On Mon, 23 Mar 2020 08:38:37 +0100, Rolf Wetjen via lazarus
<lazarus at lists.lazarus-ide.org> wrote:

>Hi Bo,
>this could be a solution for windows (fullscreen):
>     SetWindowLongPtr(Handle,GWL_STYLE,iWindowStyle and not 
>     Left:=0;
>     Top:=0;
>     Width:=Screen.Width;
>     Height:=Screen.Height;

Well, this seems to make the program window maximized and this is not
what I want.
I want the video port only to be maximized....

Meanwhile I found an example inside the PasLibVlc source package where
there is a function that seems to do what I wanted so I tried to put
it into my code.
However, it does not show any video on the resulting form, it is all
And it does not return to the application's previous form either when
I hit a keyboard key. The application's main window in this case is
all black, only the title bar is not black....

Here is the code of the button event that is supposed to maximize my
window (copied from the example and adjusted for proper player name):

procedure TfrmMain.SpeedButton1Click(Sender: TObject);
//Defined in unit FullScreenFormUnit from the example:
  aFullScreenForm : TFullScreenForm; 
  oldL, oldT, oldW, oldH : Integer;
  oldA : TAlign;
  MessageDlg('Press any key, to leave full screen mode',
mtInformation, [mbOK], 0);

  oldL := vlcPlayer.Left;
  oldT := vlcPlayer.Top;
  oldW := vlcPlayer.Width;
  oldH := vlcPlayer.Height;
  oldA := vlcPlayer.Align;

  if (oldA <> alNone) then vlcPlayer.Align := alNone;

  aFullScreenForm := TFullScreenForm.Create(SELF);
  aFullScreenForm.SetBounds(Monitor.Left, Monitor.Top, Monitor.Width,

  // PasLibVlcPlayer1.ParentWindow := aFullScreenForm.Handle;
    LCLIntf.SetParent(vlcPlayer.Handle, aFullScreenForm.Handle);
      Windows.SetParent(vlcPlayer.Handle, aFullScreenForm.Handle);
  vlcPlayer.SetBounds(0, 0, Monitor.Width, Monitor.Height);


  vlcPlayer.SetBounds(oldL, oldT, oldW, oldH);
    LCLIntf.SetParent(vlcPlayer.Handle, SELF.Handle);
      Windows.SetParent(vlcPlayer.Handle, SELF.Handle);


  if (oldA <> alNone) then vlcPlayer.Align := oldA;

Bo Berglund
Developer in Sweden

More information about the lazarus mailing list