Question

I am developing one application which shows thumbnails of running application on windows 7. Can i achieve the same thumbnail functionality on window XP.(If I run my application on XP) If Yes. Then How can i achieve this. Any idea? Thanks

Était-ce utile?

La solution

In Windows 7 you can use the Desktop Window Manager (DWM) library (amongst other things) to take screenshots / thumnails. The documentation is part of the Win API but you can use them in C3 using platform invoke:

[DllImport( "dwmapi.dll", PreserveSig = false )]
public static extern void DwmRegisterThumbnail( IntPtr destinationWindowHandle, IntPtr sourceWindowHandle, out IntPtr thumbnailHandle );

[DllImport( "dwmapi.dll", PreserveSig = false )]
public static extern void DwmUnregisterThumbnail( IntPtr thumbnailHandle );

[DllImport( "dwmapi.dll", PreserveSig = false )]
public static extern void DwmUpdateThumbnailProperties( IntPtr thumbnailHandle, ref ThumbnailProperties properties );

Finally, here is some sample code on how to implement the actual thumbnails.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top