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
8 using System.Collections.Generic;
\r
9 using System.Collections.Specialized;
\r
10 using System.ComponentModel;
\r
12 using System.Drawing;
\r
14 using System.Windows.Forms;
\r
17 using System.Diagnostics;
\r
18 using System.Threading;
\r
19 using System.Runtime.InteropServices;
\r
20 using System.Globalization;
\r
25 static class Program
\r
28 /// The main entry point for the application.
\r
33 // Development Code Expiry.
\r
34 // Remember to comment out on public release!!!
\r
35 //if (DateTime.Now > DateTime.Parse("2008/02/25", new CultureInfo("en-US"))) { MessageBox.Show("Sorry, This development build of Handbrake has expired."); return; }
\r
37 // Check the system meets the system requirements.
\r
38 Boolean launch = true;
\r
41 // Make sure the screen resolution is not below 1024x768
\r
42 System.Windows.Forms.Screen scr = System.Windows.Forms.Screen.PrimaryScreen;
\r
43 if ((scr.Bounds.Width < 1024) || (scr.Bounds.Height < 720))
\r
45 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
49 // Make sure the system has enough RAM. 384MB or greater
\r
50 uint memory = MemoryCheck.CheckMemeory();
\r
51 memory = memory / 1024 / 1024;
\r
55 MessageBox.Show("Your system does not meet the minimum requirements for HandBrake. \n Insufficient RAM. 384MB or greater required. You have: " + memory.ToString() + "MB", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
\r
59 catch (Exception exc)
\r
61 MessageBox.Show("frmMain.cs - systemCheck() " + exc.ToString());
\r
64 // Either Launch or Close the Application
\r
67 Application.EnableVisualStyles();
\r
68 Application.SetCompatibleTextRenderingDefault(false);
\r
69 Application.Run(new frmMain());
\r
80 public struct MEMORYSTATUS
\r
82 public UInt32 dwLength;
\r
83 public UInt32 dwMemoryLoad;
\r
84 public UInt32 dwTotalPhys; // Used
\r
85 public UInt32 dwAvailPhys;
\r
86 public UInt32 dwTotalPageFile;
\r
87 public UInt32 dwAvailPageFile;
\r
88 public UInt32 dwTotalVirtual;
\r
89 public UInt32 dwAvailVirtual;
\r
90 // Aditional Varibles left in for future usage (JIC)
\r
93 [DllImport("kernel32.dll")]
\r
94 public static extern void GlobalMemoryStatus
\r
96 ref MEMORYSTATUS lpBuffer
\r
99 public static uint CheckMemeory()
\r
101 // Call the native GlobalMemoryStatus method
\r
102 // with the defined structure.
\r
103 MEMORYSTATUS memStatus = new MEMORYSTATUS();
\r
104 GlobalMemoryStatus(ref memStatus);
\r
106 uint MemoryInfo = memStatus.dwTotalPhys;
\r