You want only one instance of your program to run at a time? Easy. If you are feeling particularly adventurous, I'm sure you could even figure out a simple way to switch to the currently running instance when someone tries to start a new one.
using
System;
using System.Windows.Forms;
using System.Diagnostics;
namespace Sample.SingleInstance
{
static class Program
{
[STAThread]
static void Main()
{
//ensure that only one instance of this process can run at a time
Process curProc = Process.GetCurrentProcess();
if(Process.GetProcessesByName(curProc.ProcessName).Length <= 1)
{
Application.EnableVisualStyles();
Application.Run(new frmMain());
}
}
}
}