views:

453

answers:

1

How do you create a transparent window that can be placed over another window that is actively having streaming video drawn to it. I want to create a window on top of the video window that I can draw on without video constantly drawing back over it.

I can create a window from a transparent dialog resource and set its z-order using SetWindowPos(...) but it doesn't seem to have any effect. Having the dialog set as a WS_CHILD style or WS_POPUP also appears to have no effect.

I'm using a media (video) framework another development group in my company developed and am providing a window handle to that code. That handle is being used by their rendering plugin in the pipeline that uses Direct3d for rendering the video on that window surface.

+1  A: 

Video is rendered to a hardware overlay in the video adapter. You'll need to create your own to overlay that overlay. I think DirectX provides that capability, you can also get it by using the WS_EX_LAYERED window style and the SetLayeredWindowAttributes(). Which you'll need to set the transparency key. Not so sure that's a slam-dunk btw, I've seen this behave oddly.

Hans Passant
Got this working yesterday using the WS_EX_LAYERED property with colorkey before checking in to see the answer you gave. Since the window can't be a WS_CHILD style with WS_EX_LAYERED there is some oddness for management of the overlay window. At this moment I am looking in to this oddness to try to avoid it. -Thanks for the answer though.
flawlesslyfaulted