OSDN Git Service

cee6dfa4d7fd097233e0112c295113cd6803aa9d
[handbrake-jp/handbrake-jp-git.git] / win / C# / Program.cs
1 /*  Program.cs \r
2         \r
3            This file is part of the HandBrake source code.\r
4            Homepage: <http://handbrake.fr>.\r
5            It may be used under the terms of the GNU General Public License. */\r
6 \r
7 using System;\r
8 using System.Windows.Forms;\r
9 \r
10 namespace Handbrake\r
11 {\r
12     static class Program\r
13     {\r
14         /// <summary>\r
15         /// The main entry point for the application.\r
16         /// </summary>\r
17         [STAThread]\r
18         static void Main()\r
19         {\r
20             // Check the system meets the system requirements.\r
21             Boolean launch = true;\r
22             try\r
23             {\r
24                 // Make sure the screen resolution is not below 1024x768\r
25                 System.Windows.Forms.Screen scr = Screen.PrimaryScreen;\r
26                 if ((scr.Bounds.Width < 1024) || (scr.Bounds.Height < 720))\r
27                 {\r
28                     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.ToString() + " \nScreen resolution is too Low. Must be 1024x720 or greater", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
29                     launch = false;\r
30                 }\r
31             }\r
32             catch (Exception exc)\r
33             {\r
34                 MessageBox.Show("frmMain.cs - systemCheck() " + exc);\r
35             }\r
36 \r
37             // Either Launch or Close the Application\r
38             if (launch)\r
39             {\r
40                 Application.EnableVisualStyles();\r
41                 Application.SetCompatibleTextRenderingDefault(false);\r
42                 Application.Run(new frmMain());\r
43             }\r
44             else\r
45                 Application.Exit();\r
46         }\r
47     }\r
48 \r
49 }