in a C# application that has no graphics at all, and does a bunch of network operations, I need to be able to show notification bubbles (on top of everything, for a few seconds) near the icon tray on certain events.
I've been looking at this : http://www.codeproject.com/KB/miscctrl/taskbarnotifier.aspx
But with no success. The problem with it is that the windows designed there won't show on asynchroneous events. It seems that I need a main form first on which I add delegates for it to work, which I have no need for.
All options I've seen so far require me to have a form in my application, but that won't happen. Is it impossible then to have these bubbles ? Any ideas ? There must be a way to add an icon in the tray popping messages inconditionally and without GUI right ?
Taken from Systray icon for Console application and Creating balloon tooltip in C#
Add a reference to both System.Windows.Forms and System.Drawing.
Update:
using System.Windows.Forms;
using System.Drawing;
...
private void Form1_Load(object sender, EventArgs e)
{
var item = new NotifyIcon(this.components);
item.Visible = true;
item.Icon = System.Drawing.SystemIcons.Information;
item.ShowBalloonTip(3000, "Balloon title", "Balloon text", ToolTipIcon.Info);
}
Also it can be that popups are disabled in registry.
Look at the NotifyIcon
class, it allows you to put icons into the notification area as well as doing balloon notifications which is what you're after.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With