15 lines
458 B
C#
15 lines
458 B
C#
using System.Threading;
|
|
using System.Windows;
|
|
|
|
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();
|
|
}
|
|
}
|
|
}
|
|
}
|