T
Tim Mackey
hi,
i have a really simple win forms app that just has a notifyIcon, context
menu, and timer. no forms.
the problem is that the ShowBalloon method refuses to display anything in
Vista, although it works albeit inconsistently on a Server 2003 box. the
timer does tick every 5 sec but on my server it seemed to appear the first
time correctly and then it would miss a few of the 5 second intervals, and
maybe appear later on if it felt like it. can anyone explain this? the
repro is below. just to confirm that it never ever shows in Vista.
thanks / tim.
using System;
using System.Drawing;
using System.Windows.Forms;
namespace yo
{
public class Start
{
static NotifyIcon ni;
static ContextMenu cm;
static Timer t;
[STAThread]
static void Main(string[] args)
{
cm = new ContextMenu();
cm.MenuItems.Add("Exit", OnExitClick);
ni = new NotifyIcon();
ni.ContextMenu = cm;
ni.Icon = new Icon("App.ico"); // ico file must be in the run
directory...
ni.Visible = true;
t = new Timer();
t.Tick += new EventHandler(t_Tick);
t.Interval = 5000;
t.Enabled = true;
t.Start();
Application.Run();
}
static void t_Tick(object sender, EventArgs e)
{
ni.ShowBalloonTip(2000, "hello", "hello", ToolTipIcon.Info);
}
static void OnExitClick(object sender, EventArgs e)
{
ni.Visible = false;
Application.Exit();
}
}
}
i have a really simple win forms app that just has a notifyIcon, context
menu, and timer. no forms.
the problem is that the ShowBalloon method refuses to display anything in
Vista, although it works albeit inconsistently on a Server 2003 box. the
timer does tick every 5 sec but on my server it seemed to appear the first
time correctly and then it would miss a few of the 5 second intervals, and
maybe appear later on if it felt like it. can anyone explain this? the
repro is below. just to confirm that it never ever shows in Vista.
thanks / tim.
using System;
using System.Drawing;
using System.Windows.Forms;
namespace yo
{
public class Start
{
static NotifyIcon ni;
static ContextMenu cm;
static Timer t;
[STAThread]
static void Main(string[] args)
{
cm = new ContextMenu();
cm.MenuItems.Add("Exit", OnExitClick);
ni = new NotifyIcon();
ni.ContextMenu = cm;
ni.Icon = new Icon("App.ico"); // ico file must be in the run
directory...
ni.Visible = true;
t = new Timer();
t.Tick += new EventHandler(t_Tick);
t.Interval = 5000;
t.Enabled = true;
t.Start();
Application.Run();
}
static void t_Tick(object sender, EventArgs e)
{
ni.ShowBalloonTip(2000, "hello", "hello", ToolTipIcon.Info);
}
static void OnExitClick(object sender, EventArgs e)
{
ni.Visible = false;
Application.Exit();
}
}
}