开发者

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

开发者 https://www.devze.com 2022-12-18 20:51 出处:网络
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

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.


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).


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号