如何做到覆盖图标在任务栏上的Windows 7中的.NET [英] How to do overlay icons on the taskbar in Windows 7 for .NET

查看:210
本文介绍了如何做到覆盖图标在任务栏上的Windows 7中的.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

微软 UX指南建议我使用< A HREF =htt​​p://msdn.microsoft.com/en-us/library/aa511446.aspx#overlay相对=nofollow>覆盖图标显示时,我的应用程序有关的状态信息,例如读消息或连接性。

不过,我没有多少运气找到如何让使用图标覆盖在我的应用程序启动明显的教程。有人可以推荐一个,或者更好的是,创建自己的博客上的教程为人类改善?

(问题标题中特别提到的Windows 7,但我认为这也将是有益的Vista将包含在本教程中,以及在Windows XP中,等向下兼容的问题。)

修改:这个问题是真的要求.NET 3.5使用的WinForms。下面是code快速片段,应该如果你下载下面的 ken2k的回答引用的Windows API code包

 进口Microsoft.WindowsAPI codePack.Taskbar
添加引用Microsoft.WindowsAPI codePack.Shell.dll
剪断...

如果TaskbarManager.IsPlatformSupported然后
  TaskbarManager.Instance.SetOverlayIcon(图标,altText)
结束如果
 

解决方案

我会建议使用的的Windows®API code包为Microsoft .NET框架用于包装所有shell编程的东西。

您会发现一个这里了非常详细的文章将告诉你如何使用它。

需要注意的是信用证包装的Windows®的API $ C $没有与XP(不支持)工作,是非常有限的与Vista。覆盖图标仅适用于Windows 7的实例。

Microsoft's UX guidelines recommend that I use overlay icons to show when my application has information about statuses, like unread messages or connectivity.

However, I not having much luck finding a clear tutorial on how to get starting using overlay icons in my application. Can someone recommend one, or better yet, create a tutorial on their blog for betterment of mankind?

(The question title specifically mentions Windows 7, but I think it would also be useful for Vista to be included in this tutorial, as well as backwards compatibility issues with Windows XP, etc.)

Edit: This question was really asked for .NET 3.5 using WinForms. Here's a quick snippet of code that should work if you download the Windows API Code Pack referenced below in ken2k's answer.

Imports Microsoft.WindowsAPICodePack.Taskbar
' Add reference to Microsoft.WindowsAPICodePack.Shell.dll
' Snipped...

If TaskbarManager.IsPlatformSupported Then
  TaskbarManager.Instance.SetOverlayIcon(icon, altText)
End If

解决方案

I would suggest using the Windows® API Code Pack for Microsoft® .NET Framework that wraps all the shell programming stuff.

You'll find a very detailed article here that'll show you how to use it.

Note that the Windows® API Code Pack doesn't work with XP (not supported), and is very limited with Vista. Overlay icons are only available on Windows 7 for instance.

这篇关于如何做到覆盖图标在任务栏上的Windows 7中的.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆