I am working on a screen grabbing application, which has a feature of grabbing a particular window. To make my application working with WPF applications with a good speed, I have chosen a "Direct3D hooking" approach for grabbing image of a WPF window, which
means that I install hooks for some Direct3D calls, specifically, EndScene function. This works because WPF uses Direct3D for rendering windows contents.
However I ran into the following issue:
EndScene is called with several Direct3D devices, not a single one. I have looked into contents of each device's back buffer and found out that in addition to main window rendering, there are separate devices which are used for rendering of menus and tooltips.
However EndScene is called just with a pointer to a D3D device which is used for rendering and no information about whether a main window is rendered or a menu/tooltip. Also no information is available about position of menu/tooltip relative to main window
coordinates (so that with that information I could compose a single image rendering images of window and menus/tooltips together).
So my question is: given Direct3D device which is used for rendering a window, how to identify a window (WPF window) by ob
View Complete Post