SamuraiDan

Because the DWM maintains a system memory surface containing what amouts to a texture representation of the window, there should be a way to get that image data I'm not so concerned about capturing the aero glass frame of the window as much as the client region. I want to capture that client region "image" data and use it in a WPF scengraph. Is there any precident for doing something like this




Re: UI Development for Windows Vista Capturing a window bitmap to display in WPF?

AndyCadley

You can PInvoke the DWM thumbnail APIs to get live previews of windows. There is an example here.





Re: UI Development for Windows Vista Capturing a window bitmap to display in WPF?

SamuraiDan

Unfortunatly, it's not that simple. WPF applications have a single hWnd for the parent window, all elements within a WPF scengraph are just that, elements in a scenegraph. They arn't windows in the GDI sense of a window. You can get a hWnd withing a WPF context if you create a Windows Formers Integration context, unfortunatly that element behaves a lot like a standard GDI window. You cant rotate it, scale it or anything else. The thumnail API takse a sorce hWnd and a dest hWnd which is really of little use to me. I dont want the DWM updating windows for me, i want the image Smile

If I could get access to the image data that the DWM is using when it composes the Desktop, i could slap that in a WPF image or some other container and then be rotating it and scaling it to my hearts content...






Re: UI Development for Windows Vista Capturing a window bitmap to display in WPF?

pshmo

Hey SamuraiDan,

I'm wondering if you have found a solution for this, as I am trying to do the same thing.

Thanks