4

I am using an hwndhost element to draw DirectX content in a WPF application. When I override the WndProc for HwndHost I do get called with window messages but only by the first instance of hwndhost that I create.

Basically on the WM_PAINT message I render my DirectX scene and mark the "handled" parameter as true (I do check if the hwnd passed in the WndProc is my handle). Once I mark it as true, none of the other instances of HwndHost get the WM_PAINT message.

How can I get the other HwndHost instances to receive the WM_PAINT message?

madth3
  • 7,275
  • 12
  • 50
  • 74
  • Are they siblings or children of each other? If so, they might be clipped, meaning Windows won't bother sending a `WM_PAINT` message if it thinks there is nothing to draw (because the windows are completely covered). – Mark Ingram Feb 26 '16 at 11:53
  • I was doing something similar, and found no way of handling the different hwndhost elements - instead I'm using only one hwndhost, with multiple WPF elements inside. Not done yet but it might be worth looking at this option for you too. – trapsuutjies Jul 26 '16 at 09:54

0 Answers0