wpf - 确保实现 WPF 任务栏窗口预览

标签 wpf windows-7 taskbar

当用户将鼠标悬停在任务栏图标上时,如何确保刷新 WPF 应用程序 (.net 4) 的预览。
我有一个可视化一些状态值的应用程序。如果应用程序窗口最小化并且用户将鼠标悬停在任务栏按钮上,则显示的预览窗口将显示窗口处于事件状态的窗口的最后一个 View 。但是,我想有一个实现的观点。
有没有可能实现这一目标?

最佳答案

我相信您需要自定义预览,如 here 所述(在自定义预览部分下)。其中利用了 Windows API Code Pack for Microsoft® .NET Framework .

一个例子可以在 here 中找到,但看起来像:

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;
    };

另一个例子,可以找到here其中指出:

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.



此代码的下载链接是 here ,其中包括 CustomWindowsManager 类。这似乎提供了实时预览。

关于wpf - 确保实现 WPF 任务栏窗口预览,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6298556/

相关文章:

startup - 任务管理器在任务栏 W10 中可见

c# - Windows 11 下的 WPF C# MoveWindow 问题

wpf - 如何为 WPF WebBrowser 制作动画

sql - 如何使用 Windows 身份验证登录 SQL Server

onclick - 检测单击了哪个任务栏按钮(识别目标窗口)

ios - 双击主页后后台应用程序屏幕截图显示方向错误

c# - 在流文档或 WPF RichTextBox 中创建悬挂缩进

c# - VISIBLOX,WPF : Getting chart points to scroll horizontally?

c# - Windows 服务和桌面应用程序之间的通信

固定到任务栏时,Java Web Start 遇到 CouldNotLoadArgumentException