2 using System.Collections.Generic;
\r
3 using System.Collections.Specialized;
\r
4 using System.ComponentModel;
\r
6 using System.Drawing;
\r
8 using System.Windows.Forms;
\r
11 using System.Diagnostics;
\r
12 using System.Threading;
\r
13 using System.Runtime.InteropServices;
\r
18 static class Program
\r
21 /// The main entry point for the application.
\r
27 // Check the system meets the system requirements.
\r
28 Boolean launch = true;
\r
31 // Make sure the screen resolution is not below 1024x768
\r
32 System.Windows.Forms.Screen scr = System.Windows.Forms.Screen.PrimaryScreen;
\r
33 if ((scr.Bounds.Width < 1024) || (scr.Bounds.Height < 720))
\r
35 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
39 // Make sure the system has enough RAM. 384MB or greater
\r
40 uint memory = MemoryCheck.CheckMemeory();
\r
41 memory = memory / 1024 / 1024;
\r
45 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
49 catch (Exception exc)
\r
51 MessageBox.Show("frmMain.cs - systemCheck() " + exc.ToString());
\r
55 // Either Launch or Close the Application
\r
58 Application.EnableVisualStyles();
\r
59 Application.SetCompatibleTextRenderingDefault(false);
\r
60 Application.Run(new frmMain());
\r
71 public struct MEMORYSTATUS
\r
73 public UInt32 dwLength;
\r
74 public UInt32 dwMemoryLoad;
\r
75 public UInt32 dwTotalPhys; // Used
\r
76 public UInt32 dwAvailPhys;
\r
77 public UInt32 dwTotalPageFile;
\r
78 public UInt32 dwAvailPageFile;
\r
79 public UInt32 dwTotalVirtual;
\r
80 public UInt32 dwAvailVirtual;
\r
81 // Aditional Varibles left in for future usage (JIC)
\r
84 [DllImport("kernel32.dll")]
\r
85 public static extern void GlobalMemoryStatus
\r
87 ref MEMORYSTATUS lpBuffer
\r
90 public static uint CheckMemeory()
\r
92 // Call the native GlobalMemoryStatus method
\r
93 // with the defined structure.
\r
94 MEMORYSTATUS memStatus = new MEMORYSTATUS();
\r
95 GlobalMemoryStatus(ref memStatus);
\r
97 uint MemoryInfo = memStatus.dwTotalPhys;
\r