static void Main()
{
if (mutex.WaitOne(TimeSpan.Zero, true))
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
formMain mainform = new formMain(false);
string password = mainform.XmlConfigGet("password");
if (password.Trim() != "")
{
popupPassword passwordopup = new popupPassword(password);
Application.Run(passwordopup);
if (!passwordopup.auth) return;
}
Application.Run(new formMain(true));
}
else
{
// send our Win32 message to make the currently running instance
// jump on top of all the other windows
NativeMethods.PostMessage((IntPtr) NativeMethods.HWND_BROADCAST, NativeMethods.WM_SHOWME, IntPtr.Zero, IntPtr.Zero);
}
}