Only allow 1 instance to run.

master 1.0
Sean McArdle 2017-03-16 13:14:03 -07:00
parent b9c9e53ed7
commit 7fc4d9cb75
1 changed files with 3 additions and 0 deletions

View File

@ -14,6 +14,9 @@ namespace KeyWatch__
/// </summary>
[STAThread]
static void Main() {
var progs = System.Diagnostics.Process.GetProcessesByName("KeyWatch++").ToList();
if (progs.Count > 1) { return; }
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new KeyWatchContext());