X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=win%2FC%23%2FProgram.cs;h=71f1385f28d8fdb67c7336e03bae3969c72ebaa0;hb=2157ff283ee677c229c017d13a84805b0ab24fd3;hp=f2bae9661dca1ac741e93f3ec45d0d47cc749a02;hpb=27b64d072b377fbc2b5567c88637dfdfbfe630d5;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/win/C#/Program.cs b/win/C#/Program.cs index f2bae966..71f1385f 100644 --- a/win/C#/Program.cs +++ b/win/C#/Program.cs @@ -19,46 +19,25 @@ namespace Handbrake [STAThread] static void Main() { - // 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) + Screen scr = Screen.PrimaryScreen; + if ((scr.Bounds.Width < 1024) || (scr.Bounds.Height < 620)) + 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); + else { - string appDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake"; - if (!Directory.Exists(appDir)) - Directory.CreateDirectory(appDir); - - string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs"; + string logDir = Path.Combine(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")) + if (!File.Exists(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"HandBrake\presets.xml"))) { PresetsHandler x = new PresetsHandler(); - x.updateBuiltInPresets(); + x.UpdateBuiltInPresets(); } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new frmMain()); } - else - Application.Exit(); } }