Discussion:
Directshow IVideoWindow.MessageDrain does not handle events properly
(too old to reply)
r***@gmail.com
2007-11-22 02:38:53 UTC
Permalink
Hello,

I need to be able to handle a mouse click on an IVideoWindow
object. I am upgrading VB6 code to VB .NET and setting the message
drain to the handle doesn't seem to be working, as form clicks are not
being detected. The IVideoWindow is directly on the form, not on a
picturebox. Below is my code:

Private m_objMediaControl As QuartzTypeLib.FilgraphManager
Private m_objVideoWindow As QuartzTypeLib.IVideoWindow
....
m_objVideoWindow = m_objMediaControl

m_objMediaControl.RenderFile((sVideo)) ' name of input file

m_objVideoWindow.WindowStyle = CInt(&H6000000)
m_objVideoWindow.SetWindowPosition(CInt(objVideoWindow.Left),
m_objVideoWindow.Owner = objVideoWindow.Handle.ToInt32
m_objVideoWindow.MessageDrain = objVideoWindow.Handle.ToInt32
objVideoWindow.BringToFront()
Olie
2007-12-03 17:03:45 UTC
Permalink
Have a look at the DirectShowNet library. It has a working example
which you could copy.

Loading...