Can I capture a Windows 7 DWM thumbnail window?

I'm starting to think that you can do nothing with the Windows API.

I have two windows. It has a thumbnail DWM. I want me to be able to see a window screen with a thumbnail in another. When I do this using bitblt, everything is copied except for the thumbnail. It is simply not in the bitmap.

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

Thanks a lot.

+4
source share
3 answers

This is not how DWM works: thumbnail content is never included in the DC of your window. Instead, the DWM layout engine will display a thumbnail directly above the contents of your window when the desktop is presented.

There is no (official) way to access images of DWM thumbnail data, unfortunately (however, there is a hack on the network that tries to access the base vertex data and display it in DirectX 9).

+5
source

Use

DwmRegisterThumbnail DwmUnregisterThumbnail DwnUpdateThumbnailProperties 
+2
source

You cannot expect a sketch to be placed in the context of a window device because the sketch is not placed in the context of a window device. This way your approach will not work.

But if you are trying to steal a thumbnail of an application, just ask Dwm to give you a thumbnail . This will allow you to present the user with the exact sketch you want.

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

+1
source

Source: https://habr.com/ru/post/1300244/


All Articles