I have a main window with children. I need to take screenshots programmatically to crop and draw them back on my main window. The way I do this is:
HDC hDC =
I remember having similar problems a few years back when I was attempting to screen grab a video and just getting a black region where the video had been. Got around it at the time by reducing the hardware accelaration setting on the video driver (on XP: right click desktop > properties > settings > advanced > troubleshoot).
As for a code-based solution, you might want to refer to the following previous posts:
Blank Screenshots In Vista and Win7 when gaming
Saving a screenshot of a window using C#, WPF, and DWM