views:

359

answers:

2

Hello,

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  A: 

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

stevex
Aero is turned off, also XP doesn't have it...I tmight be possible that this problem appears when Aero is off. Will test with Aero on.
Nemok
Indeed done some tests and it seems that when I disable Aero in Vista the "special" windows do not appear. With it enable they do.In XP there is no Aero option to enable so the problem occurs everytime. Any ideas?
Nemok
+3  A: 

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

Anders
Thank you. This worked.
Nemok
IMO this sort of obscure knowledge is exactly what this site is about. Thanks (even if I'll probably never use it :) )
Roel