static void Main() { if (ExistRuningInstance()) { MessageBox.Show("Another Hoo Relaxnt instance is already runing. You should not launch more than one instances.", "Error", MessageBoxButtons.OK); Application.Exit(); } else { // Exit() only teminate this application. However, it could not terminate this function. // So "else" is neccessary here. log.Debug("Start Hoo Relaxant"); CultureInfo culture = Properties.Settings.Default.Language; log.Debug(String.Format("Current culture is {0}", culture.Name)); System.Threading.Thread.CurrentThread.CurrentUICulture = culture; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); ManagerForm = new RunningForm(new RunningControl()); Application.Run(ManagerForm); } }