A Couple of Cool Uses of the DWM Thumbnail APIs


I’ve seen a couple of cool uses in the past week of the DWM Thumbnail API (described in my previous post) and wanted to share them here.


Simon on the .NET” wrote a great-looking Exposé-like mini-app that, when you press F12, shows a representation of all the desktop windows in a grid.  The original desktop is shown behind the grid.  The thumbnails are, as expected, live and updating (though they don’t accept input, as is true with DWM thumbnails in general).


Douglas Stockwell wrote a cool WPF application that PInvoke’s to the thumbnail APIs and populates a WPF ItemsControl with thumbnails of windows as you click on them.  As it stands, it has no particular purpose, but it shows some interesting integration between WPF and DWM thumbnails.


 

Comments (7)

  1. Un petit message pour faire de la pub à un ami développeur, Simon (qui n’arrete pas de me harceler pour…

  2. Arno Schoedl says:

    I started exploring interactions between DirectDraw and DWM. Two effects of DirectDraw going straight to the write-only video buffer seem to be that WM_NCCALCSIZE must return WVR_REDRAW and ScrollWindowEx cannot be used in DirectDraw windows.

  3. Imran says:

    Super duper cool and it works.

  4. Tim says:

    The thumbnail API uses HWNDs.  Is there any way to render a static image of a window as a 32-bit HBITMAP, including the alpha values for that specific window, without using an HWND?

  5. kiwiblue says:

    > There any way to render a static image

    > of a window as a 32-bit HBITMAP, including

    > the alpha values for that specific window,

    > without using an HWND?

    Probably not, due to implementation details. See http://blogs.msdn.com/greg_schechter/archive/2006/09/14/753605.aspx for more info.

    [quote]

    The way thumbnails are implemented is effectively via the same VisualBrush mechanism that we have in WPF.  The DwmRegisterThumbnail API effectively creates a link into a node representing a window in the visual tree that makes up the desktop (discussed in this post), and references that node from the thumbnail target HWND.  Thus when the thumbnail source is a live video, the target HWND is rendered by rendering that live video there as well.  So these thumbnails are very much "live". I should also point out here that things like Flip3D cannot be built using the thumbnail API.  That’s because thumbnails are always rendered head on in their target window in 2D

    [/quote]

  6. Using Application Thumbnails in Vista

Skip to main content