1:Add two file "MutexEx.cs" and "NativeMethod.cs" from OpenNETCF into your solution.
2:Code here
static void Main()
{
OpenNETCF.Threading.MutexEx mutex = new OpenNETCF.Threading.MutexEx(true,"hahahaha");
bool running = !mutex.WaitOne(0,false);
if(!running)
Application.Run(new Form1());
else
MessageBox.Show("Already running.");
}
{
OpenNETCF.Threading.MutexEx mutex = new OpenNETCF.Threading.MutexEx(true,"hahahaha");
bool running = !mutex.WaitOne(0,false);
if(!running)
Application.Run(new Form1());
else
MessageBox.Show("Already running.");
}