5
votes

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.

2
for me it didnt capture videos - Umair Ahmed
Interesting... Does pressing Print Screen perform the same? - sharptooth
@Umair Ahmed: I think that Print Screen itself doesn't capture videos - the_drow
Actually Print Screen performs as expected. - Nemok
yep print screen does fail to capture screen. (not always but i never troubleshooted exactly when it fails). - Umair Ahmed

2 Answers

7
votes

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

1
votes

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