none
DWM Live Thumbnail Capturing? RRS feed

  • Question

  • Hello all!

    Is there a way to capture the live window content we can get from a DWM Thumbnail? As I understand it, the live thumbnail is slapped on the window area during the composition process, so any capture methods would require DWM APIs exposing said functions. Perhaps it would be a good idea to have a function that returns a HBITMAP for saving to disk, or saves the file directly given the path and file type.

    It would be useful to have such an API for screenshot programs: select a window and have a screenshot taken, including the transparent frame regions that DWM gives to thumbnails.

    Thanks,

                 Karl

    Sunday, July 23, 2006 1:26 AM

Answers

  • I'm afraid there isn't a separate API for this. The only way to capture the rendering of a thumbnail or the glass frames is to do a screen capture, via GetDC(NULL)+BitBlt. As long as you can guarantee that your app is topmost for the duration of the capture and you know where the window is on screen you can restrict the capture rect to the window rect.
    Monday, July 24, 2006 8:58 PM

All replies

  • I'm afraid there isn't a separate API for this. The only way to capture the rendering of a thumbnail or the glass frames is to do a screen capture, via GetDC(NULL)+BitBlt. As long as you can guarantee that your app is topmost for the duration of the capture and you know where the window is on screen you can restrict the capture rect to the window rect.
    Monday, July 24, 2006 8:58 PM
  • I didn't think there was. Unforunatley, that isn't the solution I was looking for. I was looking for a way to capture the transparent regions as transparent - a true capture of the window. Also, for some oddly-shaped windows, it can be a little difficult.

    Is an API for this being considered? The ability to pass an HBITMAP for DWM to copy the window surface on to would be nice.

    Also, while we're on the subject of the live thumbnails, how does Flip3D work with them? I mean, DWM needs a HWnd to draw the thumbnails on to, but Flip3D seems to be able to draw them on to 3D surfaces. I'd love to be able to draw live window thumbnails on to WPF 3D objects and things like that. Being limited to rectangular areas on windows is so not cool.

    Monday, July 24, 2006 9:17 PM
  • These are both good requests, but unfortunately we won't be able to accomodate them on this first release of the DWM.

    The Flip 3D view is drawn directly by the DWM, which owns the entire desktop, so we have a lot more freedom about how to draw the windows in that case. Adding the thumbnails to a WPF scene graph is not possible, mainly because the thumbnails are composed by the DWM over the client area of a window, whereas a thumbnail that was part of a scene would have to compose "within" the contents of the window. The DWM doesn't have intimate knowledge about the window's scene graph; it only knows about its own, desktop-wide graph.

    I should mention, for completeness, that if you write a WPF application then you can redraw your own window to a bitmap by using the RenderTargetBitmap class. That won't include any thumbnails on that window, however.

    Tuesday, July 25, 2006 7:47 AM
  • well that really is a big shame - I see Vista as more of a platform on which the next-generation OS will be built (the 'longhorn' if you like). That makes DWM one of the most awesome tools on that platform - a well structured, close-to-WPF platform. But the lack of these APIs seriously limit what developers can do with the DWM - we can't make our own cool window switchers, and we can't capture the thumbnails (this alone has numerous possible applications)

    Related to the issue of building applications to leverage DWM, is it possible to access and edit DWM's UITree? Like, say I wanted to replace my desktop wallpaper with a WPF-generated UITree.

    It seems to me that DWM is being used more as a tool to aid other applications rather than as a platform itself which can be leveraged. That's a real shame, because its bursting with potential.

    If these are limitations which are in turn limited to DWM v1.0, when and how can we expect to see DWM v>1.0? Are there plans for releasing DWM updates outside of the major revisions to Windows? I know Ray Ozzie in interviews seems keen on updating system components regularly. Like, not just fixing bugs and giving the very occasional WMP update, but refreshing the system to add value. This is what I expect from things like the sidebar, and hopefully DWM will be able to update itself, too (although perhaps in a service pack or something, since a separate system component update is bad practice without a more refined versioning system, something like Apple has...)

    Karl

    Wednesday, July 26, 2006 7:59 PM
  • There is a lot more that we can and will do with the DWM in future releases, but, of course, it would be premature to talk about future releases when we are still working on the current one .
    Thursday, July 27, 2006 11:44 PM
  • Hello Leonardo
    I am currently working on a project related to the same topic. Do you know if there has been any progress in that?
    Thursday, November 28, 2019 10:03 PM