WPF Enforce only ONE instance of application

后端 未结 5 514
温柔的废话
温柔的废话 2021-01-30 17:12

How do I allow only one instance of a WPF application to run?

Thanks.

5条回答
  •  旧巷少年郎
    2021-01-30 17:48

    http://blogs.microsoft.co.il/blogs/arik/archive/2010/05/28/wpf-single-instance-application.aspx

    Doesn't require VB.DLL as some other examples advise. Has WPF sample code. Passes any cmd line args to initial instance.

提交回复
热议问题