views:

93

answers:

4

Pardon my frustration. I've asked about this in many places and I seriously don't think that there wouldn't be a way in Windows 7 SDK to accomplish this.

All I want, is to capture part of a 'child window' ( setParent() ) created by a parent. I used to do this with bitblt() but the catch is that the child window can be any type of application, and in my case has OpenGL running in a section of it. If I bitblt() that, then the OGL part comes blank, doesn't get written to the BMP.

DWM, particularly dwmRegisterThumbnail() doesn't allow thumbnail generation of child windows. So please give me a direction.

Thanks.

+1  A: 

It's been a while since I did any of this, so my explanation might be a bit vague, but from what I remember, the Windows doesn't "see" the OpenGL rendered inside the window.

What Windows does is create the window at the specified size and then "hands it over" to OpenGL for rendering. This means that you can't get at the pixels as rendered from the Windows side of the code.

When we wanted to capture the 3D we had to re-render the screen to an off screen bitmap which was then saved (or printed).

Obviously a whole screen capture (Print Screen) works because it's reading the final pixels.

ChrisF
A: 

I don't have access to the source code of any child window that may be open including the one with OpenGL

Dogan Demir
+1  A: 

I suggest that you:

  1. Forget the Thumbnail part of the task (in terms of capture).
  2. Calculate where your window is.
  3. Capture full screen.
  4. Excise the area you are interested in (using data from step 2).
  5. Rescale to the appropriate thumbnail size.

Sorry, its more work, but it should work, which is better than what you have right now.

Stephen Kellett