How to Check If App Already Running in VB.NET CF

// Expert user has replied.
P Peter McWha 3 years 7 months ago
3 1 0

The interface for starting applications makes it easy for users to accidentally start multiple copies of the same application.
 
How does a VB.NET application using the compact framework determine if there is another copy of itself running?  The System.Diagnostic.Process namespace is practically useless.

Please Register or Login to post a reply

1 Replies

P Pietro Francesco Maggi

Hi Peter,
Usually you use a Mutex to have a single instance of your app running.

When you app your launch, it checks if your Mutex is already defined. If yes, there's another instance running that you can bring in foreground and close the second one.
If no mutex exist, you create it and keep running.

You can find samples on internet mainly in C# on how to do this:
.NET Reference Guide | Creating a Single-Instance Program | InformIT
c# - What is the best way to make a single instance application in Compact Framework? - Stack Overflow

~Pietro

CONTACT
Can’t find what you’re looking for?