diff options
Diffstat (limited to 'grapher/Program.cs')
| -rw-r--r-- | grapher/Program.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/grapher/Program.cs b/grapher/Program.cs index 85fd040..485e074 100644 --- a/grapher/Program.cs +++ b/grapher/Program.cs @@ -11,9 +11,19 @@ namespace grapher [STAThread] static void Main() { + var mutex = new System.Threading.Mutex(true, "RawAccelGrapher", out bool result); + + if (!result) + { + MessageBox.Show("Another instance of the Raw Accel Grapher is already running."); + return; + } + Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new RawAcceleration()); + + GC.KeepAlive(mutex); } } } |