Added tray icon support

This commit is contained in:
Jason
2026-05-29 10:46:43 -05:00
parent cce9248089
commit 5623a6efbc
17 changed files with 1541 additions and 4 deletions
+35
View File
@@ -0,0 +1,35 @@
namespace PrintServiceTray;
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
try
{
// Prevent multiple instances
bool createdNew;
using var mutex = new Mutex(true, "LAAPC_PrintServiceTray_Mutex", out createdNew);
if (!createdNew)
{
MessageBox.Show("LAAPC Print Service Tray is already running.", "Already Running",
MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
ApplicationConfiguration.Initialize();
Application.Run(new TrayApplicationContext());
GC.KeepAlive(mutex);
}
catch (Exception ex)
{
MessageBox.Show($"Fatal error: {ex.Message}\n\n{ex.StackTrace}", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}