Page 1 of 1

Notify parent window

Posted: 23 Sep 2009 14:59
by dmihmih
Good day!
libvls 1.0.1 for Windows
Is it possible to handle all mouse and key messages in parent window (wich is set by libvlc_media_player_set_hwnd)?
--vout-event=3 does not help
Thanks!

Re: Notify parent window

Posted: 23 Sep 2009 17:28
by RĂ©mi Denis-Courmont
vout-event is only implemented by the X11 outputs currently.

Re: Notify parent window

Posted: 23 Sep 2009 23:42
by weiguo
Hi

I am new to VLC. I am using VLC player to show live video with PTZ (pan, titlt, zoom) control feature. The PTZ control is done by a separate class (has nothing to do with VLC), but I need to capture the mouse events of mouse left button down, mouse left button up, mouse move and wheel move from a VLC control. How do I do this?

I have tries to tap into Windows message loop, no luck.

I am using C# with VS 2008

thanks in advance!!!

Wei Guo

Re: Notify parent window

Posted: 25 Sep 2009 18:38
by Mountazar
Hi just wanted to share my workaround to this limitation under Windows OS.
I have VLC 1.0.1 installed under Windows XP
In order to disable the double-click going into vlc fullscreen mode, as well as to handle the mouse events over the vlc display I had to do it in the following simple way :

- The VlcControl (the window hosting the vlc display) has been made Disabled (Control.Enable = false)
- The VlcControl is hosted with DockStyle.Full in a Panel control (the panel control is the parent of the VlcControl)

Since the VlcControl is disabled then all mouse events made over it will go to its parent and handled there. This has been tested successfully.
Even it is disabled it is able to show a playing movie.
If ever you still want the going into fullscreen but to handle other events by yourself, you have to request it explicitly from the parent (panel double-click handler).
Enjoy,
Mountazar

Re: Notify parent window

Posted: 02 Oct 2009 19:18
by Ultraseamus
Not sure if your problems have already been resolved, but I did get my solution for this problem working recently. First I tell VLC what I want the window to be named:

Code: Select all

"--video-title", "directxVLC"
After that you can use the name to get the handle to the window:

Code: Select all

handleVLC = FindWindow(NULL, "directxVLC");
With the handle you can pretty much do anything you want to the window. For this specific problem you probably want to replace its wndProc with your own:

Code: Select all

oldWndProc = (WNDPROC)SetWindowLongPtr(handleVLC, GWLP_WNDPROC, (LONG_PTR)WndProc);
In that code "oldWndProc" is the proc originally used by the window. You need to keep track of this so that you can send it all of the messages you do not want to process (like paint messages).

After that you can process all of the window's messages. But, I will mention that for me the mouse messages were all hidden inside of the LPARAM of WM_MOUSEACTIVATE messages. Also note that the WM_MOUSEACTIVATE message is special, if you do not want the mouse clicks to be processed by any other code make sure you return the appropriate value. http://msdn.microsoft.com/en-us/library ... 85%29.aspx

This is more the non vlc solution, which I went with because I could not personally get libvlc_media_player_set_hwnd to work. Hope it helps.