public frmMeter() { // Load splashscreen frmSplashscreen splashscreen = new frmSplashscreen(); // Show it splashscreen.Show(); InitializeComponent(); // Double buffer the form drawing in order to prevent flickering SetStyle(ControlStyles.OptimizedDoubleBuffer, true); SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); // Hide the splashscreen splashscreen.hideSplash(); }
static void Main() { iniFile = new IniFile(); try { iniFile.IniFilePath("language/" + Config.get_language() + ".ini"); } catch (FileNotFoundException) { DialogResult result1 = MessageBox.Show("Language file not found, please download file. Click Yes for download file. Save file into language folder.", "Error, no language file", MessageBoxButtons.YesNo); if (result1 == DialogResult.Yes) { System.Diagnostics.Process.Start("https://github.com/crystal-web/AION-Meter-Reloaded/tree/master/language/" + Application.ProductVersion); } return; } // Control de version pour l'update versionControl(); // Pas lancé deux fois ^^ using (Mutex mutex = new Mutex(false, "Global\\" + guid)) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); writer.WriteToLog("Running application guid:" + guid + " version:" + Application.ProductVersion); if (!mutex.WaitOne(0, false)) { DialogResult result1 = MessageBox.Show( "Can not run multi instance off this AIONMeter-Reloaded. Kill all instance ?", "Error, multi instance", MessageBoxButtons.YesNo ); if (result1 == DialogResult.Yes) { foreach (Process proc in Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName)) { proc.Kill(); } } return; } // Test si l'application est lancé en mode administrateur if (!isAdministrator()) { DialogResult result = MessageBox.Show( "Unauthorized Access, please run this application in Administrator mode", "Unauthorized Access", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1 ); return; } isConfigReady(); // void // https://raw.githubusercontent.com/crystal-web/AION-Meter-Reloaded/master/Release/updates.txt // Application.ProductVersion // Try to switch to configured locale try { Thread.CurrentThread.CurrentUICulture = new CultureInfo(Config.get_language()); } catch (Exception) { MessageBox.Show( "The language " + Config.get_language() + " couldn't be loaded. Reverting culture to en-US.", "Language Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Config.set_language("en-US"); } // Game splash ^^ frmSplashscreen splash = new frmSplashscreen(); minifyLog(0); splash.hideSplash(); main_window = new frmMeter(); Application.Run(main_window); } }