http://www.codeproject.com/Articles/32908/C-Single-Instance-App-With-the-Ability-To-Restore

 

 

   /// <summary>
        
/// The main entry point for the application.
        
/// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            bool onlyInstance = false;
            Mutex mutex = new Mutex(true"RedirectorConfigurationTool"out onlyInstance);
            if (!onlyInstance)
            {
                MessageBox.Show("Only one instance can be lunched at the same time");
                return;
            }
            else
            {
                Application.Run(new ConfigurationTool());
            }
        }

 

相关文章:

  • 2021-12-25
  • 2021-12-11
  • 2021-10-30
  • 2022-12-23
  • 2022-03-09
  • 2022-02-09
  • 2022-12-23
猜你喜欢
  • 2021-06-08
  • 2022-12-23
  • 2021-06-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-14
相关资源
相似解决方案