Well, that's just a snippet - could you show the whole code, in the
form of a short but complete program?
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
bool blnFirstInstance;
Mutex objMutex = new Mutex(false, "Local\\" + "abcdefg", out
blnFirstInstance);
if (!blnFirstInstance)
{
MessageBox.Show("App is already running", "Single Use Only",
MessageBoxButtons.OK, MessageBoxIcon.Stop);
Application.Exit();
}
// rest of Main() code
}
Works perfectly on 64-bit Vista Business, doesn't work on 32-bit
WinXPPro+SP2 - haven't tried on any other version of Windows...