Click here to Skip to main content
15,880,299 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a small problem when playing photos and videos with DirectShow. I mean ...

I followed an example downloaded online in which selecting the file to play, it preproduce without problem. Supposedly it does on a PictureBox. Researching on the code, I see that it really does is create a window ActiveMovieWindow, where played the video and then selects the PictureBox as parent container of that form. Before establishing the ActiveMovieWindow removing the title bar and controls minimize, maximize and close. Visually it looks good, as if reproduced on the PictureBox.
The problem is that I have no access to the event "MouseClick / MouseDoubleClick" of the PictureBox, because the form ActiveMovieWindow not respond to them.

My question, and I ask for help, is how I can play the video on the PictureBox without using ActiveMovieWindow? If this is not possible, then how I can detect and MouseDoubleClick MouseClick ActiveMovieWindow form?.

Thank you in advance for your help.

1 solution

Get the handle of the PictureBox by accessing it's Handle property. Then p/invoke directshow, passing the handle as parameter. Not only PictureBox, you can also do the same on a Label which is more simpler. (WinForms equivalent of WinAPI STATIC control).
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900