using System; using System.Threading; using System.Windows.Forms; namespace Decal.DenAgent { static class Program { [STAThread] static void Main() { // Single instance check using var mutex = new Mutex(true, "DecalAgentMutex", out bool createdNew); if (!createdNew) { MessageBox.Show("Decal Agent is already running.", "Decal Agent", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new TrayContext()); } } }