IE hosted ActiveX: how to render DirectShow EVR inside IE IE object

I am trying to display a video in Internet Explorer using a native ActiveX control.

I created an ActiveX control and a demo HTML page by creating the control with the OBJECT tag (and setting the width / height on it). I can call simple methods on this control via javascript, it works.

I also created a directshow work schedule to display the video. The plot contains an Enhanced Video Renderer (EVR) rendering filter.

But I am stuck: I cannot find a way to link these 2 technologies. In some MSDN docs, EVR is required to use WindowLess activation. But this activation requires hWnd and a rectangle inside hWnd. My ActiveX is hosted in Internet Explorer, how can I get the hWnd and render render at the correct position / size in this window?

Please note that I know how to get the absolute rectangle of an object in javascript and pass it to ActiveX. But can this rectangle move with the scroll bar? And how do I get that damn hWnd?


It seems ActiveX should implement the IOleInPlaceObjectWindowless interface, which has SetObjectRects methods called by the host, and should query the host for the IOleWindow interface, which has a GetWindow method that returns hWnd.


It seems all you have to do is implement IComponent to restore the ISite host interface from which you can request any service you need.


source to share

All Articles