class App : SingletonApplication
{
private Mutex mMutex;
protected override void OnStartup(StartupEventArgs theArgs)
{
bool bIsNewInstance = false;
mMutex = new Mutex(true, "Test.SingletonApp", out bIsNewInstance);
if(!bIsNewInstance)
{
App.Current.Shutdow();
}
}
}
No comments:
Post a Comment