Hermes/App.xaml.cs

15 lines
458 B
C#
Raw Normal View History

using System.Threading;
using System.Windows;
2020-09-07 22:24:37 +02:00
namespace Hermes {
public partial class App : Application {
private Mutex instanceMutex = new Mutex(true, "HERMES_INSTANCE_MUTEX");
public App() {
if(!instanceMutex.WaitOne(0)) {
MessageBox.Show("Hermes est déjà en cours d'exécution.", "Hermes", MessageBoxButton.OK, MessageBoxImage.Information);
Shutdown();
}
}
2020-09-07 22:24:37 +02:00
}
}