starface-outlook-sync-addin/src/StarfaceOutlookSync/Program.cs

34 lines
902 B
C#

using System;
using System.Threading;
using System.Windows.Forms;
namespace StarfaceOutlookSync
{
static class Program
{
private static Mutex _mutex;
[STAThread]
static void Main()
{
// Nur eine Instanz erlauben
const string mutexName = "StarfaceOutlookSync_SingleInstance";
_mutex = new Mutex(true, mutexName, out bool createdNew);
if (!createdNew)
{
MessageBox.Show(
"Starface Outlook Sync laeuft bereits.",
"Starface Outlook Sync",
MessageBoxButtons.OK,
MessageBoxIcon.Information);
return;
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new UI.MainForm());
}
}
}