justinstenning / Direct3DHook

DirectX Capture and Overlays by using Direct3D API hooks
http://spazzarama.com/2011/03/14/c-screen-capture-and-overlays-for-direct3d-9-10-and-11-using-api-hooks
MIT License
580 stars 178 forks source link

Screenshot background window #74

Closed Kuhicop closed 4 years ago

Kuhicop commented 4 years ago

Hello, this is more a question than an issue but I hope someone can help

It's possible to take screenshots from a background window without setting it as foreground?

If it's possible, how can I do it?

Thank you

justinstenning commented 4 years ago

This already does it, but not if minimised (if Direct3D). Otherwise GDI BitBlt might work.

Kuhicop commented 4 years ago

Please could you tell me how to do it without setting the window at front (foreground)?

When I run the TestScreenshot form it's taking the window to front and taking the screenshot but what I need is taking a screenshot from a window without bringing to front

Thank you very much and sorry for reopen

EDIT: I just set the lines containing BringProcessWindowToFront(); as comment and worked perfectly, thank you very much <3

justinstenning commented 4 years ago

Exactly what I was going to suggest, enjoy.