DWM Thumbnails. But with IDCompositionVisual.

Have you ever wondered how DWM Thumbnails were so buttery smooth on Windows 8 and newer when making animations/transitions (in the shell)?

No? Well, one thing is sure; they are not using public APIs like DwmRegisterThumbnail and DwmUpdateThumbnailProperties.

Let me present you…
*drum rolls*
…fresh new private APIs to get a shared Visual from any window of your choice.

Let’s get started!

Nota bene: Since symbols are stripped for these functions I had to guess the name and the type, which wasn’t that easy as it sounds.

Nota bene 2: Since Windows 10 build 20xxx (or maybe a bit earlier) there were some tiny changes in two functions.

What to include:

Definitions:

How to get these functions:

These DLL exports don’t have function names, so you have to GetProcAddress with ordinal instead of the function name.

Create a new DirectComposition Device:

Create a Window:

Gluing it all together

Create a window thumbnail

Create a MultiWindow/VirtualDesktop thumbnail

You can use DwmUpdateThumbnailProperties to update thumbnail properties. For anything else, you can rely on IDCompositionDevice/Visual and make great animations. 🙂

Full demo code: DWM Thumbnail/VirtualDesktop IDCompositionVisual example (github.com)

Also, something about IDCompositionDevice & Windows.UI.Composition.Compositor interop coming SOONâ„¢

Demo with animations!

3 thoughts on “DWM Thumbnails. But with IDCompositionVisual.”

  1. Hey, Thank you for the post, i have been searching for this for a long time, can i get a contact email of you, i have been trying to replicate the acrylic blur effect, i think it is possible using this method to get the host backdrop brush (the content behind my window). Please leave me a message back.

    Reply
  2. Hi!
    Dont You know how to enable thumbnail live preview of minimized window, like it does wmp?
    May be this parameter helps to do it WCA_VIDEO_OVERLAY_ACTIVE?

    Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Enable Notifications OK No thanks