Single instance windows forms application and how to get reference on it?

前端 未结 4 412
轮回少年
轮回少年 2021-01-06 02:09

I have a Windows Forms application that allows only one instance to be running at the time. I have implemented Singleton by using Mutex. The Application must be startable fr

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-06 02:37

    The .NET framework offers a very good generic solution for this. Check the bottom of this MSDN magazine article. Use the StartupNextInstanceHandler() event handler to pass arbitrary commands to the running instance, like "quit".

提交回复
热议问题