You must use a named mutex so that it can be used in all processes. For some (stupid) reason, CF designers thought that CF developers would never need such a thing, so you have 2 options:
- P / Invoke CreateMutex and its associated cleanup element
- Use an already written implementation, such as the SDF class NamedMutex (which is just # 1 for you) from OpenNETCF.
In fact, there is a third option. SDF The Application2 class has a pair of Overloading the startup method that wraps this logic for you and enables the application of single-user behavior.
source share