C#, Compact Framework 2.0

G

Guest

I wrote a C# Application for Microsoft .NET CF 2.0. It is used on Microsoft
Pocket PC, Version 4.20.0 (Build 14053).
Is there a way to prevent my Application to be startet twice?

Best Regards
 
V

Vadym Stetsyak

Hello, pfluft!

p> I wrote a C# Application for Microsoft .NET CF 2.0. It is used on
p> Microsoft Pocket PC, Version 4.20.0 (Build 14053).
p> Is there a way to prevent my Application to be startet twice?

Yes. You can used named Mutex object to detect if another instance of application is running.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
 
V

Vadym Stetsyak

Hello, pfluft!

p> Named Mutexes are not supportet in the compact Framework.

Indeed, named Mutexes aren't supported in CF 2.0.
As a workaround for this limitationsolution you can P/Invoke
on coredll.dll and create unmanaged named mutex object.

Then Mutex.Handle Property can be used to attach managed Mutex
object and manipulate that unmanaged one.
--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
 
G

Guest

I know this is an old topic, but my unerstanding is the CF automatically
blocks the same applicayion from loading twice. Do I have this right?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top