0

I've programmed an application that superimposes semi-transparent child windows. For this I use the flag WS_EX_COMPOSITED in a common parent window. Now I've found a provider that renders 3D models, but it turns out that the rendering is done using DirectDraw methodologies, and the 3D render window generates a black area with WS_EX_COMPOSITED on, and everything is okay with Composited off. How can I convince the DWM not to draw the DirectDraw window in the DoubleBuffered chain but right after the double buffering, or else that doesn't prevent DirectDraw? Is there any relevant experience?

enter image description here

Simon Mourier
  • 132,049
  • 21
  • 248
  • 298
  • `WS_EX_COMPOSITED` controls the painting order of all descendants. You do not get to choose, which descendants are affected. That said, this is a window style that predates desktop composition. If you want to do compositing, you probably should not be using the GDI at all. Keeping your fingers crossed that the component you're planning to use cooperates, and doesn't mandate going through the legacy GDI layer. – IInspectable May 19 '23 at 13:25
  • GDI works great with WS_EX_COMPOSITED if you always use the device handle from WM_PAINT and build the graphics there. The tool I chose probably uses the GDI device handle for rendering, which can be obtained from the window via GetDC, but which is ultimately not the DC of the DoubleBuffered context provided with WS_EX_COMPOSITED in WM_PAINT. I think it is working with CreateBitmapRenderTarget and the WDM doesn't use this marked handle to fill the buffer. My guess... – René Rössler May 20 '23 at 17:25
  • Would be easy for Windows developers to use in DefWindowProc the handle of GetDC to fill the buffer by default, if there is a DC marked for Direct3D or Direct2D rendering. – René Rössler May 20 '23 at 17:40

0 Answers0