locked
WPF - Setting Windows 7 thumbnail to image (rather than clipping rectangle) RRS feed

  • Question

  • There seems to be very little documentation on this. What I'm trying to do is set the thumbnail image to my own image (ImageSource/BitmapSource), rather than have it use a clipping rectangle, since the live thumbnail doesn't work while the window is minimized.

    I've managed to set the thumbnail image using this code, but it has a few problems. (Note: Microsoft.WindowsAPICodePack.Taskbar is imported)

    Dim preview As TabbedThumbnail = TaskbarManager.Instance.TabbedThumbnail.GetThumbnailPreview(New Interop.WindowInteropHelper(Me).Handle)
    If preview Is Nothing Then
      preview = New TabbedThumbnail(New Interop.WindowInteropHelper(Me).Handle, New Interop.WindowInteropHelper(Me).Handle)
      TaskbarManager.Instance.TabbedThumbnail.AddThumbnailPreview(preview)
    End If
    preview.SetImage(myImage.Source)

    It sets the thumbnail image successfully, but it causes my thumbnail buttons to disappear and I can't get them back. Also, clicking on the thumbnail does nothing. Even worse, when I hover over the thumbnail, the image I set it to shows up over my window, like it's the actual window preview. I just want to set the thumbnail, not change how my window looks when you hover over the thumbnail.

    Does anyone know how to do this?

    It just needs to 1. keep my thumbnail buttons, 2. not mess with the full window preview (hovering over the thumbnail), and 3. focus my window when I click on the thumbnail (tried Me.Focus() , didn't work).

    Thanks,
    Grant

    • Moved by Yves.Z Friday, March 11, 2011 6:23 AM Windows APICodePack related (From:Windows Presentation Foundation (WPF))
    Wednesday, March 9, 2011 10:57 PM

Answers

All replies