What is the correct way to create a single instance application?

Posted by Nidonocu on Stack Overflow See other posts from Stack Overflow or by Nidonocu
Published on 2008-08-21T00:33:59Z Indexed on 2010/05/05 0:58 UTC
Read the original article Hit count: 177

Filed under:
|
|
|

Using C# and WPF under .net (rather than WindowsForms or console), what is the correct way to create an application that can only be run as a single instance? I know it has something to do with some mythical thing called a mutex, rarely can I find someone that bothers to stop and explain what one of these are.

The code needs to also inform the already running instance that the user tried to start a second one, and maybe also pass any command line arguments if any existed.

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET