X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=win%2FC%23%2FProgram.cs;h=f2bae9661dca1ac741e93f3ec45d0d47cc749a02;hb=6aa1d8aec5bac19ce4430415ea2021c11fb4bf3d;hp=0a4e40b4ecc6f817b53a532b748308d4d2ac2b4b;hpb=27f7ae7e0f897835c0f0d2a107d67a56a83bef86;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/win/C#/Program.cs b/win/C#/Program.cs index 0a4e40b4..f2bae966 100644 --- a/win/C#/Program.cs +++ b/win/C#/Program.cs @@ -1,6 +1,13 @@ +/* Program.cs + + This file is part of the HandBrake source code. + Homepage: . + It may be used under the terms of the GNU General Public License. */ + using System; -using System.Collections.Generic; using System.Windows.Forms; +using System.IO; +using Handbrake.Presets; namespace Handbrake { @@ -12,9 +19,47 @@ namespace Handbrake [STAThread] static void Main() { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new frmMain()); + // Check the system meets the system requirements. + Boolean launch = true; + try + { + // Make sure the screen resolution is not below 1024x768 + Screen scr = Screen.PrimaryScreen; + if ((scr.Bounds.Width < 1024) || (scr.Bounds.Height < 720)) + { + MessageBox.Show("Your system does not meet the minimum requirements for HandBrake. \n" + "Your screen is running at: " + scr.Bounds.Width + "x" + scr.Bounds.Height + " \nScreen resolution is too Low. Must be 1024x720 or greater", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + launch = false; + } + } + catch (Exception exc) + { + MessageBox.Show("frmMain.cs - systemCheck() " + exc); + } + + // Either Launch or Close the Application + if (launch) + { + string appDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake"; + if (!Directory.Exists(appDir)) + Directory.CreateDirectory(appDir); + + string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs"; + if (!Directory.Exists(logDir)) + Directory.CreateDirectory(logDir); + + if (!File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\presets.xml")) + { + PresetsHandler x = new PresetsHandler(); + x.updateBuiltInPresets(); + } + + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new frmMain()); + } + else + Application.Exit(); } } + } \ No newline at end of file