whats your opinion to create something like that

its called tray Icon
so user can close all forms
and the app still running
,, and user can go back to app any time
lets start coding (note this is WPF Application)
private NotifyIcon m_notifyIcon;
private ContextMenuStrip m_contextMenu;
private bool _ForceClose;
public MainWindow()
{
InitializeComponent();
CreateNotifyIcon();
}
private void CreateNotifyIcon()
{
m_contextMenu = new ContextMenuStrip();
ToolStripMenuItem mI1 = new ToolStripMenuItem { Text = "Open" };
mI1.Click += (sender, args) => Maximize();
ToolStripMenuItem mI2 = new ToolStripMenuItem { Text = "Exit" };
mI2.Click += (sender, args) => EndApplication();
m_contextMenu.Items.Add(mI1);
m_contextMenu.Items.Add(mI2);
//Initalize Notify Icon
m_notifyIcon = new NotifyIcon
{
Text = "Application Title",
Icon = new Icon("Icon.ico"),
//Associate the contextmenustrip with notify icon
ContextMenuStrip = m_contextMenu,
Visible = true
};
}
and we have these functions
protected void Minimize()
{
Hide();
}
protected void Maximize()
{
Show();
this.WindowState =WindowState.Normal;
}
protected void EndApplication()
{
Minimize();
Thread.Sleep(1000);
_ForceClose = true;
WindowState = WindowState.Normal;
this.Close();
Environment.Exit(0);
}
and in Window Closing
event listener (don't forget to add it)
private void Window_Closing(object sender, CancelEventArgs e)
{
if (_ForceClose == false)
{
e.Cancel = true;
Minimize();
}
}
that's it, hope it help you