关于操作系统托盘图标

来源:互联网 发布:个人seo 编辑:程序博客网 时间:2024/04/27 03:00

为方便操作系统托盘图标,写了一个模块:

 

 

关于气泡提示的超时时间,曾迷惑了一段时间,经常发现气泡提示不会在设置的超时时间满足后自动消失。而且一个程序显示的气泡未消失前,其他程序的气泡弹不出来。这些问题都在MSDN中找到了答案,以下是MSDN中关于NOTIFYICONDATA的uTimeout的描述,摘录如下。

uTimeout
Union with uVersion. The timeout value, in milliseconds, for a balloon ToolTip. The system enforces minimum and maximum timeout values. uTimeout values that are too large are set to the maximum value and values that are too small default to the minimum value. The system minimum and maximum timeout values are currently set at 10 seconds and 30 seconds, respectively. See the remarks for further discussion of uTimeout.

 

Remarks

If you set the NIF_INFO flag in the uFlags member, the standard ToolTip is replaced by a balloon ToolTip. For more discussion of balloon ToolTips, see the Using ToolTip Controls chapter.

No more than one balloon ToolTip at a time is displayed for the taskbar. If an application attempts to display a ToolTip when one is already being displayed, the ToolTip will not appear until the existing balloon ToolTip has been visible for at least the system minimum timeout value. For example, a balloon ToolTip with uTimeout set to 30 seconds has been visible for seven seconds when another application attempts to display a balloon ToolTip. If the system minimum timeout is ten seconds, the first ToolTip displays for an additional three seconds before being replaced by the second ToolTip. If the user does not appear to be using the computer, the system does not count this time towards the timeout.

MSDN写的很明白,如果用户没有操作电脑——没有动鼠标或键盘,系统是不会为系统托盘气泡记超时的。这是在XP下的情况,据说在win2000下没有这个问题,没有测试,不置可否。
另外,系统托盘一次只能显示一个气泡,后面的气泡至少要等到前面显示的气泡达到最小超时时间后才能显示。

原创粉丝点击