I have a windows application (C#) and i need to configure it to run one instance from the application at the time , It means that one user clicked the .exe file and the appl
Assuming you are using C#
static Mutex mx;
const string singleInstance = @"MU.Mutex";
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
try
{
System.Threading.Mutex.OpenExisting(singleInstance);
MessageBox.Show("already exist instance");
return;
}
catch(WaitHandleCannotBeOpenedException)
{
mx = new System.Threading.Mutex(true, singleInstance);
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}