Ejemplo n.º 1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            bool createdNew;

            _instanceMutex = new Mutex(true, Assembly.GetEntryAssembly().FullName, out createdNew);
            if (!createdNew)
            {
                _instanceMutex = null;
                WindowMessageHelper.PostMessage(-1, SingleInstanceBehavior.ShowWindowMessage, 0, 0);

                Current.Shutdown();
                return;
            }

            base.OnStartup(e);
        }
Ejemplo n.º 2
0
 static SingleInstanceBehavior()
 {
     ShowWindowMessage = WindowMessageHelper.RegisterWindowMessage(SHOWWINDOW_MESSAGE);
 }