PDA

Click to See Complete Forum and Search --> : [RESOLVED] Prevent second instance of application


vbud
Dec 3rd, 2006, 10:27 PM
Hi all,

I have an application built in C# on .Net Compact Framework 2.0. I want to prevent my app to run in a second instance. Basically I need to prevent any other instance of the app to load, like what was used to be done in vb6 with App.PrevInstance. I've found that Mutex or even loop through the process list could seems that this is not possible on .Net CF. Can anyone please help.
Thanks

petevick
Dec 4th, 2006, 01:25 AM
HI,
if this is PocketPC, then it is managed for you and only 1 instance will run. If it is Windows CE then you need to take a look at createmutex.

Pete

vbud
Dec 4th, 2006, 02:04 AM
Thanks for the tip. I finally ended using CreateMutex and yes its on Win CE.