-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProgram.cs
More file actions
25 lines (21 loc) · 1.01 KB
/
Copy pathProgram.cs
File metadata and controls
25 lines (21 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using System.Threading;
namespace GhostDeck;
internal static class Program
{
[STAThread]
private static int Main(string[] args)
{
// Any argument = CLI mode: forwarded to the running instance over the pipe, or executed
// one-shot against the EC. The tray app itself never starts with arguments.
if (args.Length > 0) return Cli.Run(args);
using var showSignal = new EventWaitHandle(false, EventResetMode.AutoReset, "GhostDeck_ShowMainWindow");
using var mtx = new Mutex(true, "GhostDeck_SingleInstance", out bool createdNew);
if (!createdNew) { showSignal.Set(); return 0; } // already running - ask it to show its window
Updater.CleanupAfterUpdate(); // drop leftover GhostDeck.update.exe / .bak from a previous update
Application.SetHighDpiMode(HighDpiMode.PerMonitorV2);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new TrayContext());
return 0;
}
}