C # WPF Maintains a separate bootloader instance
I have loader.exe with Main () that loads 'UI' in WPF, the point is I only want one instance of loader.exe, how can I achieve it?
Is there a way the user clicks loader.exe, he has to check if the existing loader.exe is running and not doing anything.
currently I have
loader.exe
from
main()
....
..
Load UI
...
the loader has no idea what its loading, etc., so I can't do much with the loader project ...
Any n support code is highly appreciated
Thanks in advance.
source to share
We use the following C # code to determine if the application is running:
using System.Threading;
string appSpecificGuid = "{007400FE-003D-00A5-AFFE-DA62E35CC1F5}";
bool exclusive;
Mutex m = new Mutex(true, appSpecificGuid, out exclusive);
if (exclusive) {
// run
} else {
// already running
}
Regards, Tamberg
source to share
Take a look:
Also, you can find a more detailed answer in the following post here on StackOverflow:
What is the correct way to create a single instance application?
source to share
This is my simple and helpful solution: http://blogs.microsoft.co.il/blogs/maxim/archive/2010/02/13/single-instance-application-manager.aspx
source to share