Notify parent window

This forum is about all development around libVLC.
dmihmih
New Cone
New Cone
Posts: 1
Joined: 23 Sep 2009 14:50

Notify parent window

Postby dmihmih » 23 Sep 2009 14:59

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!

Rémi Denis-Courmont
Developer
Developer
Posts: 15266
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Notify parent window

Postby Rémi Denis-Courmont » 23 Sep 2009 17:28

vout-event is only implemented by the X11 outputs currently.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

weiguo
New Cone
New Cone
Posts: 1
Joined: 23 Sep 2009 23:24

Re: Notify parent window

Postby weiguo » 23 Sep 2009 23:42

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

Mountazar
New Cone
New Cone
Posts: 6
Joined: 25 Sep 2009 18:26

Re: Notify parent window

Postby Mountazar » 25 Sep 2009 18:38

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

Ultraseamus
Blank Cone
Blank Cone
Posts: 18
Joined: 06 May 2009 18:47

Re: Notify parent window

Postby Ultraseamus » 02 Oct 2009 19:18

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.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 17 guests