How to get a screenshot from the background window DirectX

2.7k Views Asked by At

I was looking for examples of how to make a screenshot of an inactive window, but I did not find it. I want to take a screenshot of the game that works in the window, and not in full screen mode. Which can be blocked by other windows.

I found some examples on the Internet, but could not implement in my project.

Could you set an example of how to do this with the help of EasyHook and SharpDX (or SlimDX) on language C#?

I'll be very grateful!

1

There are 1 best solutions below

2
Justin Stenning On

I created an example project for this on GitHub, https://github.com/spazzarama/Direct3DHook

Allows screen capture and drawing an overlay into the Direct3D target application using C#, EasyHook and SharpDX.

Keep in mind that some games will employ anti-injection/hooking techniqiues that may block EasyHook.

In addition this usually won’t work for minimised applications as it is best practice to pause your render loop when minimised.