我以一种相当简单的方式使用 NotifyIcon。
public class Popup
{
...
private static NotifyIcon ni;
static Popup()
{
ni = new NotifyIcon();
ni.Icon = SystemIcons.Information;
}
public Popup(string nexusKey)
{
...
}
public void make(string text)
{
try
{
...
}
catch
{
ni.Visible = true;
ni.ShowBalloonTip(1000, "Thats the title", text, ToolTipIcon.Info);
}
}
}
问题是,如果我关注的窗口与托管显示气球的进程的窗口不同,那么“保持活力”计时器似乎不会启动。关于如何确保气球在 1 秒后消失的任何想法?