diff --git a/ISCamRecorder/Program.cs b/ISCamRecorder/Program.cs index 59eb4ff..d3e3f8e 100644 --- a/ISCamRecorder/Program.cs +++ b/ISCamRecorder/Program.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; @@ -11,6 +12,16 @@ /// [STAThread] static void Main() { + //ミューテックス作成 + Mutex app_mutex = new Mutex(false, "ISCamRecorder_Mutex"); + + //ミューテックスの所有権を要求する + if (app_mutex.WaitOne(0, false) == false) { + MessageBox.Show("本ソフトウェアは複数起動できません。"); + return; + } + + // 起動 Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm());