a2d3643d69
SystemIcons.GetStockIcon(StockIconId.NetworkConnect, 32) — no external files needed.
42 lines
1.0 KiB
C#
42 lines
1.0 KiB
C#
namespace gatuna_client;
|
|
|
|
static class Program
|
|
{
|
|
[STAThread]
|
|
static void Main()
|
|
{
|
|
ApplicationConfiguration.Initialize();
|
|
|
|
var form = new MainForm();
|
|
|
|
using var tray = new NotifyIcon
|
|
{
|
|
Icon = SystemIcons.GetStockIcon(StockIconId.NetworkConnect, 32),
|
|
Text = "gatuna",
|
|
Visible = true,
|
|
};
|
|
|
|
tray.ContextMenuStrip = new ContextMenuStrip();
|
|
tray.ContextMenuStrip.Items.Add("Show", null, (_, _) =>
|
|
{
|
|
form.Show();
|
|
form.WindowState = FormWindowState.Normal;
|
|
form.Activate();
|
|
});
|
|
tray.ContextMenuStrip.Items.Add("-");
|
|
tray.ContextMenuStrip.Items.Add("Exit", null, (_, _) =>
|
|
{
|
|
tray.Visible = false;
|
|
form.Close();
|
|
});
|
|
tray.DoubleClick += (_, _) =>
|
|
{
|
|
form.Show();
|
|
form.WindowState = FormWindowState.Normal;
|
|
form.Activate();
|
|
};
|
|
|
|
Application.Run(form);
|
|
}
|
|
}
|