Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>To capture Direct3D windows that are in the background (or moved off screen), I believe you have the following options:</p> <ol> <li><p>Inject and hook Direct3D within the target application via the link you have already posted <a href="http://spazzarama.com/2011/03/14/c-screen-capture-and-overlays-for-direct3d-9-10-and-11-using-api-hooks/" rel="noreferrer">or this more up-to-date example</a> (EasyHook can be difficult to get setup but it does work really well) - you can always ask for help about getting it working. I have used that technique for capturing in a number of games without issues (most recently for an ambilight-clone project). The problem with this approach is your concern about game protection causing bans, however FRAPs also uses hooking to achieve this, so perhaps your concerns are exaggerated? I guess gamers being banned for a screen shot is an expensive way of finding out.</p></li> <li><p>For windowed applications on Vista/Win 7 - you could inject and hook the DWM and make your capture requests through its shared surface. I have had this <a href="http://spazzarama.com/2009/02/12/screen-capture-with-vista-dwm/" rel="noreferrer">working on Vista</a>, but have not finished getting it working on Windows 7, here is an example of it working for Windows 7 <a href="http://www.youtube.com/watch?v=G75WKeXqXkc" rel="noreferrer">http://www.youtube.com/watch?v=G75WKeXqXkc</a>. The main problem with this approach is the use of undocumented API's which could mean your application breaks without any warning upon a windows patch release - also you would have to redo the technique for each new major Windows flavour. This also does not address your need to capture in Windows XP.</p></li> <li><p>Also within the DWM, there is a thumbnail API. This has limitations depending on what your trying to do. There is some information on this API along with other DWM API's here <a href="http://blogs.msdn.com/b/greg_schechter/archive/2006/09/14/753605.aspx" rel="noreferrer">http://blogs.msdn.com/b/greg_schechter/archive/2006/09/14/753605.aspx</a></p></li> <li><p>There are other techniques for intercepting the Direct3D calls without using EasyHook, such as substituting the various DLL's with wrappers. You will find various other game hooking/interception techniques here: <a href="http://www.gamedeception.net/" rel="noreferrer">http://www.gamedeception.net/</a></p></li> <li><p>Simply bring the Direct3D application to the foreground (which I guess is undesirable in your situation) - this wouldn't work for off-screen windows unless you also move the window.</p></li> <li><p>Unfortunately the only solution for Windows XP that I can think of is intercepting the Direct3D API in some form.</p></li> </ol> <p>Just a clarification on Direct3D rendering while minimised. During my fairly limited testing on this matter I have found this to be application dependant; it is generally <a href="http://forums.create.msdn.com/forums/t/53677.aspx" rel="noreferrer">not recommended</a> that rendering take place while the application is minimized (also this <a href="http://www.toymaker.info/Games/html/direct3d_faq.html#D3DMIN" rel="noreferrer">reference</a>), it does continue to render while in the background however.</p> <p><strong>UPDATED</strong>: provided additional link to more up-to-date injection example for point 1.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload