static void Main() { Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); IntPtr pShcoreDll = HiResSupport(); if (mutex.WaitOne(TimeSpan.Zero, true)) { // Service.Notifier noty = null; noty = Service.Notifier.Instance; Application.Run(); mutex.ReleaseMutex(); } else { MessageBox.Show(I18N("ExitOtherVGCFirst")); } Lib.DllLoader.FreeLibrary(pShcoreDll); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Service.Notifier noty = Service.Notifier.Instance; Application.Run(); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // load Shcore.dll and get high resolution support IntPtr pDll = Lib.DllLoader.LoadLibrary(@"Shcore.DLL"); Lib.DllLoader.CallMethod( pDll, @"SetProcessDpiAwareness", typeof(SetProcessDpiAwareness), (method) => ((SetProcessDpiAwareness)method).Invoke(2)); Service.Notifier noty = Service.Notifier.Instance; Application.Run(); Lib.DllLoader.FreeLibrary(pDll); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // load Shcore.dll and get high resolution support IntPtr pDll = Lib.DllLoader.LoadLibrary(@"Shcore.DLL"); Lib.DllLoader.CallMethod( pDll, @"SetProcessDpiAwareness", typeof(SetProcessDpiAwareness), (method) => ((SetProcessDpiAwareness)method).Invoke(2)); if (mutex.WaitOne(TimeSpan.Zero, true)) { try { Service.Notifier noty = Service.Notifier.Instance; Application.Run(); } catch (Exception ex) { #if DEBUG MessageBox.Show(ex.ToString()); #else SaveUnhandledException(ex.ToString()); #endif } mutex.ReleaseMutex(); } else { MessageBox.Show(I18N("ExitOtherVGCFirst")); } Lib.DllLoader.FreeLibrary(pDll); }