-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathProgram.cs
33 lines (31 loc) · 959 Bytes
/
Program.cs
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
26
27
28
29
30
31
32
33
using System;
using System.Threading;
using System.Windows.Forms;
namespace PiperTrayClassic
{
static class Program
{
static Mutex mutex = new Mutex(true, "{8F6F0AC4-B9A1-45fd-A8CF-72F04E6BDE8F}");
[STAThread]
static void Main()
{
if (mutex.WaitOne(TimeSpan.Zero, true))
{
try
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new PiperTrayApp());
}
finally
{
mutex.ReleaseMutex();
}
}
else
{
MessageBox.Show("Another instance of Piper Tray Classic is already running.", "Piper Tray Classic", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
}