2 This file is part of the HandBrake source code.
\r
3 Homepage: <http://handbrake.fr>.
\r
4 It may be used under the terms of the GNU General Public License. */
\r
6 namespace Handbrake.Functions
\r
8 using System.Windows.Forms;
\r
9 using Microsoft.Win32;
\r
12 /// The System Information.
\r
14 public class SystemInfo
\r
17 /// Gets the total physical ram in a system
\r
19 /// <returns>The total memory in the system</returns>
\r
20 public static uint TotalPhysicalMemory
\r
24 Win32.MEMORYSTATUS memStatus = new Win32.MEMORYSTATUS();
\r
25 Win32.GlobalMemoryStatus(ref memStatus);
\r
27 uint memoryInfo = memStatus.dwTotalPhys;
\r
28 memoryInfo = memoryInfo/1024/1024;
\r
35 /// Gets the number of CPU Cores
\r
37 /// <returns>Object</returns>
\r
38 public static object GetCpuCount
\r
42 RegistryKey regKey = Registry.LocalMachine;
\r
43 regKey = regKey.OpenSubKey("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0");
\r
44 return regKey == null ? 0 : regKey.GetValue("ProcessorNameString");
\r
49 /// Gets the System screen size information.
\r
51 /// <returns>System.Windows.Forms.Scree</returns>
\r
52 public static Screen ScreenBounds
\r
54 get { return Screen.PrimaryScreen; }
\r