One Copy at a Time

  • Thread starter Thread starter Thom Little
  • Start date Start date
T

Thom Little

How can I limit an application to running only one copy of itself at a time?
 
You need a named Mutex for this type of cross process communication.
 
Try this :


Process[] myProcess = Process.GetProcessesByName("YOUR_PROGRAM");
if (myProcess.Length>1)
{
MessageBox.Show("Application is already running...");
}
else
{
Application.Run(new frmMain());
}




Regards,
Cybertof.
 

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

Back
Top