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.Windows.Forms;
\r
9 using Microsoft.Win32;
\r
11 namespace Handbrake.Functions
\r
16 /// Returns the total physical ram in a system
\r
18 /// <returns></returns>
\r
19 public static uint TotalPhysicalMemory
\r
23 Win32.MEMORYSTATUS memStatus = new Win32.MEMORYSTATUS();
\r
24 Win32.GlobalMemoryStatus(ref memStatus);
\r
26 uint memoryInfo = memStatus.dwTotalPhys;
\r
27 memoryInfo = memoryInfo/1024/1024;
\r
34 /// Get the number of CPU Cores
\r
36 /// <returns>Object</returns>
\r
37 public static Object GetCpuCount
\r
41 RegistryKey regKey = Registry.LocalMachine;
\r
42 regKey = regKey.OpenSubKey("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0");
\r
43 return regKey == null ? 0 : regKey.GetValue("ProcessorNameString");
\r
48 /// Get the System screen size information.
\r
50 /// <returns>System.Windows.Forms.Scree</returns>
\r
51 public static Screen ScreenBounds
\r
53 get { return Screen.PrimaryScreen; }
\r