Screen capture ignores some windows

2019-04-08 16:40发布

问题:

I am working in MFC and I am trying to capture a bmp of the desktop. I am using GetDC(NULL) to do this but it seems it ignores special skinned windows. It seems to ignore windows drawn with UpdateLayeredWindow. This behaviour seems to be happening only on Vista x64 and XP. I have also tried GetWindowDC with the desktop HWND but the result is the same.

NOTES: 1) Print Screen works. 2) On Vista if I enable Aero the screen captures are ok, "special" windows appear. So on Vista it only happens when Aero is disabled.

An ideas?

Thank you.

回答1:

When calling BitBlt(), add the CAPTUREBLT flag to "capture" layered windows



回答2:

This could be because of desktop composition. Turn off the Aero desktop composition in Vista and try it again.