OSDN Git Service

WinGui:
[handbrake-jp/handbrake-jp-git.git] / win / C# / Program.cs
1 /*  Program.cs\r
2     This file is part of the HandBrake source code.\r
3     Homepage: <http://handbrake.fr>.\r
4     It may be used under the terms of the GNU General Public License. */\r
5 \r
6 namespace Handbrake\r
7 {\r
8     using System;\r
9     using System.IO;\r
10     using System.Windows.Forms;\r
11     using Presets;\r
12 \r
13     /// <summary>\r
14     /// HandBrake Starts Here\r
15     /// </summary>\r
16     public static class Program\r
17     {\r
18         /// <summary>\r
19         /// The main entry point for the application.\r
20         /// </summary>\r
21         [STAThread]\r
22         public static void Main()\r
23         {\r
24             Screen scr = Screen.PrimaryScreen;\r
25             if ((scr.Bounds.Width < 1024) || (scr.Bounds.Height < 620))\r
26                 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 1024x620 or greater", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
27             else\r
28             {\r
29                 string logDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"HandBrake\logs");\r
30                 if (!Directory.Exists(logDir))\r
31                     Directory.CreateDirectory(logDir);\r
32 \r
33                 if (!File.Exists(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"HandBrake\presets.xml")))\r
34                 {\r
35                     PresetsHandler x = new PresetsHandler();\r
36                     x.UpdateBuiltInPresets();\r
37                 }\r
38 \r
39                 Application.EnableVisualStyles();\r
40                 Application.SetCompatibleTextRenderingDefault(false);\r
41                 Application.Run(new frmMain());\r
42             }\r
43         }\r
44     }\r
45 }