(WPF C#)
I want to minimize app to system tray, but without icon in taskbar:
So i set:
this.ShowInTaskbar = false;
Then undesirable icon disappeared but new bar appears on desktop!
Does somebody please have idea how to solve this problem after minimization?
Here is my important part of code:
private void stateChangedEvent(object sender, EventArgs e)
{
if (WindowState.Minimized == WindowState)
{
this.ShowInTaskbar = false;
var iconHandle = Properties.Resources.iconPaw.GetHicon();
notifyIcon.Icon = System.Drawing.Icon.FromHandle(iconHandle);
notifyIcon.Click += new EventHandler(this.WindowsStateToNormal);
notifyIcon.Visible = true;
notifyIcon.BalloonTipText = "Radek app";
notifyIcon.BalloonTipTitle = "Welcome Message";
notifyIcon.BalloonTipIcon = System.Windows.Forms.ToolTipIcon.Info;
notifyIcon.ShowBalloonTip(3000);
}
}
private void WindowsStateToNormal(object Sender, EventArgs e)
{
this.WindowState = WindowState.Normal;
notifyIcon.Visible = false;
}