"Tolga Tanriverdi" <to***@sylveria.gen.tr> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
I made a gui program with c# but i want even if people double click my
program more than once it would only open once
is something like that possible if it is how?
Use a global mutex to identify your running instance.
This way you prevent running multiple instances machine wide.
bool freeToRun;
string safeName = "Global\\StringUniquelyIdentifyingThisApplication" ;
using(System.Threading.Mutex m = new System.Threading.Mutex(true, safeName
, out freeToRun))
{
if (freeToRun)
Application.Run (new MainForm());
MessageBox.Show("Already running...", safeName);
}
Willy.