i want to make sure that only one instance of application run...
i added the mutex check but it causes problem in 64 bit system. the second way is to search process table.. This check can be easily defeated by renaming application. please tell me how to make sure that only one instance of application run.
following code is used for mutex
bool createdNew = true;
using (Mutex mutex = new Mutex(true, "MyApplicationName", out createdNew))
{
if (createdNew)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
the problem with this on XP 64 bit after 2 or 3 minutes it generates StackOverflowExcpetion and causes my application to crash.. i thoroughly tested and came to result that use of mutex is causing this problem