设置以编程方式创建的任务栏覆盖图标
我正在以编程方式重新创建覆盖图标,以便在任务栏图标上显示文本。我这样做了:
GlyphRunDrawing gDrawing = new GlyphRunDrawing(Brushes.Black,
iconOverlayText.ToGlyphRun());
Window.TaskbarItemInfo =
new System.Windows.Shell.TaskbarItemInfo();
DrawingImage image = new DrawingImage();
image.Drawing = gDrawing;
Window.TaskbarItemInfo.Overlay = image;
图像源看起来很好,如果我将“image”设置为测试 wpf 图像的源,则文本显示得很好。但由于某种原因,它没有显示在任务栏图标上。你知道为什么吗?
所以我尝试了一些其他选项,例如官方任务栏支持库。这有点令人困惑,因为它们看起来有两个,但都没有为我显示图标覆盖:
它不适用于这个官方示例应用程序示例 MainDemo 和 IMClient 演示:
我无法启动另一个由于这个神秘错误,示例集合称为 Win7API Codepack 示例:
TaskDialog 功能需要加载 comctl32.dll 版本 6,但内存中当前加载了不同版本。
有什么建议可能是错的吗?
I'm in the process of programmatically recreating an overlay icon so to present text on the taskbar icon. I did this:
GlyphRunDrawing gDrawing = new GlyphRunDrawing(Brushes.Black,
iconOverlayText.ToGlyphRun());
Window.TaskbarItemInfo =
new System.Windows.Shell.TaskbarItemInfo();
DrawingImage image = new DrawingImage();
image.Drawing = gDrawing;
Window.TaskbarItemInfo.Overlay = image;
The image source seems fine, if I set "image" as the source of a test wpf image, the text displays just fine. But for some reason, it doesn't display on the taskbar icon. Do you know why?
So I tried a few other options, like the official taskbar support libraries. It's a little confusing, because there are two of them seemingly, but neither worked to show an icon overlay for me:
It doesnt work on this official sample application sample MainDemo and IMClient demo:
And I can't start the other samples collection called Win7API Codepack sample, because of this cryptic error:
TaskDialog feature needs to load version 6 of comctl32.dll but a different version is current loaded in memory.
Any suggestion what might be wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从 TaskbarItemInfo.Overlay 的备注部分:
From the Remarks section of TaskbarItemInfo.Overlay: