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
26 // 633265950858281250 = 16:52 28-Sep-07 //864000000000 nanoseconds per day
\r
27 //long start = DateTime.Now.Ticks;
\r
28 //if (start > 633274593039531250) {MessageBox.Show("Sorry, This development build of Handbrake has expired."); return; } // Will Expire Oct 8th
\r
30 // Check the system meets the system requirements.
\r
31 Boolean launch = true;
\r
34 // Make sure the screen resolution is not below 1024x768
\r
35 System.Windows.Forms.Screen scr = System.Windows.Forms.Screen.PrimaryScreen;
\r
36 if ((scr.Bounds.Width < 1024) || (scr.Bounds.Height < 768))
\r
38 MessageBox.Show("Your system does not meet the minimum requirements for HandBrake. \n Screen resolution is too Low. Must be 1024x768 or greater", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
\r
42 // Make sure the system has enough RAM. 384MB or greater
\r
43 uint memory = MemoryCheck.CheckMemeory();
\r
45 if (memory < 319) // Set to 319 to allow for 64MB dedicated to video Memory and Windows returnig the memory figure slightly out.
\r
47 MessageBox.Show("Your system does not meet the minimum requirements for HandBrake. \n Insufficient Memory. 384MB or greater required.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
\r
51 catch (Exception exc)
\r
53 if (Properties.Settings.Default.GuiDebug == "Checked")
\r
55 MessageBox.Show("frmMain.cs - systemCheck() " + exc.ToString());
\r
60 // Either Launch or Close the Application
\r
63 Application.EnableVisualStyles();
\r
64 Application.SetCompatibleTextRenderingDefault(false);
\r
65 Application.Run(new frmMain());
\r
76 public struct MEMORYSTATUS
\r
78 public UInt32 dwLength;
\r
79 public UInt32 dwMemoryLoad;
\r
80 public UInt32 dwTotalPhys; // Used
\r
81 public UInt32 dwAvailPhys;
\r
82 public UInt32 dwTotalPageFile;
\r
83 public UInt32 dwAvailPageFile;
\r
84 public UInt32 dwTotalVirtual;
\r
85 public UInt32 dwAvailVirtual;
\r
86 // Aditional Varibles left in for future usage (JIC)
\r
89 [DllImport("kernel32.dll")]
\r
90 public static extern void GlobalMemoryStatus
\r
92 ref MEMORYSTATUS lpBuffer
\r
95 public static uint CheckMemeory()
\r
97 // Call the native GlobalMemoryStatus method
\r
98 // with the defined structure.
\r
99 MEMORYSTATUS memStatus = new MEMORYSTATUS();
\r
100 GlobalMemoryStatus(ref memStatus);
\r
102 uint MemoryInfo = memStatus.dwTotalPhys;
\r