Ensure WPF Taskbar Window Preview is actualized

一世执手 提交于 2019-12-03 14:16:00

I believe you'd need to customize the preview, as described here (under the Customizing Preview section). Which leverages the Windows API Code Pack for Microsoft® .NET Framework.

An example can be found here, but looks like:

TabbedThumbnail preview = new TabbedThumbnail(parentForm.Handle, childForm.Handle);
TaskbarManager.Instance.TabbedThumbnail.AddThumbnailPreview(preview);
preview.TabbedThumbnailBitmapRequested += (o, e) =>
    {
        Bitmap bmp = new Bitmap(width, height);

        // draw custom bitmap...

        e.SetImage(bmp);
        e.Handled = true;
    };

Another example, can be found here which states:

The CustomWindowsManager class provides an abstraction of a customized window thumbnail preview and live preview (peek), including the facilities to receive a notification when a preview bitmap is requested by the Desktop Window Manager (DWM) and to automatically grab the preview bitmap of a window.

The download link for this code is here, which includes the CustomWindowsManager class. This appears to provide the live preview.

You probably can't. Windows 7 pipes the graphics of an open window to the live preview from the Taskbar. It can't know what the window now looks like while it is minimized because it isn't being drawn at all.

I guess it's not impossible to do custom thumbnails. Aside from CodeNaked's answer, I also found this article, which even includes multiple thumbnails from the same app.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!