diff --git a/shadowsocks-csharp/Program.cs b/shadowsocks-csharp/Program.cs index 840356c6..abfc52a9 100755 --- a/shadowsocks-csharp/Program.cs +++ b/shadowsocks-csharp/Program.cs @@ -21,6 +21,9 @@ namespace Shadowsocks { using (Mutex mutex = new Mutex(false, "Global\\" + "71981632-A427-497F-AB91-241CD227EC1F")) { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + if (!mutex.WaitOne(0, false)) { Process[] oldProcesses = Process.GetProcessesByName("Shadowsocks"); @@ -35,8 +38,6 @@ namespace Shadowsocks #if !DEBUG Logging.OpenLogFile(); #endif - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); ShadowsocksController controller = new ShadowsocksController(); MenuViewController viewController = new MenuViewController(controller);