Ok, vlc creates two child windows into window you pass in the libvlc_media_player_set_hwnd function every time you play a video. One of these windows is maked to get mouse events, and the other window is used to output the video.
Windows schema :
1 MyWindow
2 -VlcEnvetWindow
3 --VlcOutputWindow
You need get handle of VlcEventWindow. To get these handle i use a timer when video starts to play and into these timer i use EnumChildWindows passing in the hWnd MyWindow to search the inmediate child. I use a timer because vlc windows take some time to be created.
Code: Select all
// First step is start a timer when you play a video,
// Second step : in the timer function i call :
EnumChildWindows(MyWindow_HWND, EnumerateVLC, NULL);
// Third step : if EnumerateVlc get some child window these window is the VlcEventWindow, and need disable it, to reach mouse events on MyWindow
BOOL CALLBACK EnumerateVLC(HWND hWndvlc, LPARAM lParam) {
EnableWindow(hWndvlc, FALSE);
// And kill timer, i only need get this handle one time.
return TRUE;
}
// When EnumerateVLC is called all mouse events are redirected to MyWindow
And remember, when you stop/finish the video vlcwindows are destroyed, and you need to get new handle every time after this ocours on your play function.
Another thing is, when you pause the video, vlcwindows are not destroyed, and its not necesary get VlcEventWindow handle again.
Sorry for my poor english again, and Good luck.