OSDN Git Service

WinGui:
[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.Collections.Generic;\r
9 using System.Collections.Specialized;\r
10 using System.ComponentModel;\r
11 using System.Data;\r
12 using System.Drawing;\r
13 using System.Text;\r
14 using System.Windows.Forms;\r
15 using System.Net;\r
16 using System.IO;\r
17 using System.Diagnostics;\r
18 using System.Threading;\r
19 using System.Runtime.InteropServices;\r
20 using System.Globalization;\r
21 \r
22 \r
23 namespace Handbrake\r
24 {\r
25     static class Program\r
26     {\r
27         /// <summary>\r
28         /// The main entry point for the application.\r
29         /// </summary>\r
30         [STAThread]\r
31         static void Main()\r
32         {\r
33             // Check the system meets the system requirements.\r
34             Boolean launch = true;\r
35             try\r
36             {\r
37                 // Make sure the screen resolution is not below 1024x768\r
38                 System.Windows.Forms.Screen scr = System.Windows.Forms.Screen.PrimaryScreen;\r
39                 if ((scr.Bounds.Width < 1024) || (scr.Bounds.Height < 720))\r
40                 {\r
41                     MessageBox.Show("Your system does not meet the minimum requirements for HandBrake. \n" + "Your screen is running at: " + scr.Bounds.Width.ToString() + "x" + scr.Bounds.Height.ToString() + " \nScreen resolution is too Low. Must be 1024x720 or greater", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
42                     launch = false;\r
43                 }\r
44             }\r
45             catch (Exception exc)\r
46             {\r
47                 MessageBox.Show("frmMain.cs - systemCheck() " + exc.ToString());\r
48             }\r
49 \r
50             // Either Launch or Close the Application\r
51             if (launch == true)\r
52             {\r
53                 Application.EnableVisualStyles();\r
54                 Application.SetCompatibleTextRenderingDefault(false);\r
55                 Application.Run(new frmMain());\r
56             }\r
57             else\r
58                 Application.Exit();\r
59         }\r
60     }\r
61 \r
62 }