My final implementation uses the later as it is the simpler and more effective approach for my needs.
Both approaches use “DLL injection” to directly access the address space of the target application: This approach involves first hooking the “Direct3DCreate9” method within d3d9so that we can return our own custom IDirect3D9 instance wrapping the original IDirect3D9 instance within an “Interface Wrapper” class.
Update: 14th March 2011 – here is a new version that supports Direct3D 10 and 11: Update: 16th April 2010 – updated code to handle fullscreen applications in a more stable manner (issue was around user inputs and Window’s getting confused about which application/window should be in the foreground).
Also fixed bug where the width height of the region to capture were needlessly being adjusted for the x1,y1,x2,y2 format of RECT – Slim DX now marshal’s the Rectangle to a RECT with this conversion for us. I have tried two approaches to hooking the Direct3D Device: “Hooking and Interface Wrapping” and “Hooking VTable function addresses”.
Narrator reads dialog boxes and window controls in a number of the more basic applications for Windows.
There's nothing more nerve wrecking than developing a computer which usually is slower as compared to human minds.
The purpose of computers end up being to be able to do super human things at super human rates.
To work effectively with Direct3D this approach also requires that the host application be running and hook the “Direct3DCreate9” within the target application before the target application has finished initialising its usage of Direct3D (Direct3DCreate9 is called right at the start of any Direct3D9 application, and usually only once).
This introduces potential timing issues, and does not allow you to hook a target application that is already running (a minor inconvenience really).