I'm using BitBlt
winapi function to take a screenshot of a given window, even if the window is partially overlapped.
I have everything working fine already, except that, on Windows 10, for some windows (like the Edge browser) the screenshot turns out completely black.
A number of other questions concur on attributing this problem to the use of a hardware-accelerated graphics context on those windows.
Apparently the GDI library is incompatible with that kind of graphics context so a different library has to be used.
My question is specifically about how to detect if a window is using a graphics context that's incompatible with the GDI library.
If I'm able to detect this, then I can choose which library to use for capturing the screenshot correctly (GDI, ActiveX or other).
Otherwise, the only way I could detect this is by scanning the screenshot pixel by pixel to check that's completely black. Then using a different capture method till I get some content on the screenshot.
But this sounds like an awful solution.
I have everything working fine already, except that, on Windows 10, for some windows (like the Edge browser) the screenshot turns out completely black.
You can use DwmRegisterThumbnail to capture hidden/overlapped windows, in particular UWP (like Edge, Calc, etc...)
I use it on Windows 10 without problem (+ D3D to save the bitmap)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With