Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to capture a window with windows 7 DWM thumbnail in it?

I am starting to believe that you can do nothing with Windows API.

I have two windows. One has a DWM thumbnail in it. What I want to do is, I want to be able to capture the screen of the window with the thumbnail into the other one. When I do this, using bitblt, everything is copied except the thumbnail. It just isn't there in the bitmap.

So how does the DWM rendering work? I mean, if DWM renders thumbnails directly onto the DC of the registered window, then my approach should work. I'm confused.

Thanks a bunch.

like image 830
Dogan Demir Avatar asked Feb 03 '10 23:02

Dogan Demir


2 Answers

That's not how DWM works: the contents of the thumbnail are never blitted onto the DC of your window. Instead, the DWM composition engine will render the thumbnail directly over the contents of your window when the desktop is presented.

There's no (official) way to access the image data of a DWM thumbnail unfortunately (there is however a hack on the net that tries to access the underlying vertex data and render it in DirectX 9).

like image 169
LorenzCK Avatar answered Oct 13 '22 17:10

LorenzCK


You cannot expect a thumbnail to be place in a window's device context, because the thumbnail is not placed in a window's device context. So your approach will not work.

But if you're trying to steal the thumbnail of an application, just ask the Dwm to give you it's thumbnail. That will allow you to present to the user the exact thumbnail you want.

If, on the other hand, you want to access the pixels in the thumbnail of another process, then you have a problem.

like image 31
Ian Boyd Avatar answered Oct 13 '22 16:10

Ian Boyd