From d655bd1bda60d6390428cf05de1e247e38fa1905 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 9 Jan 2010 20:44:10 +0000 Subject: WinGui: - Refactor the Activity window code. Hopefully the code is not thread-safe which should fix a couple of display problems with the log view. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3056 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/C#/Functions/System.cs | 56 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 win/C#/Functions/System.cs (limited to 'win/C#/Functions') diff --git a/win/C#/Functions/System.cs b/win/C#/Functions/System.cs new file mode 100644 index 000000000..83882fe4c --- /dev/null +++ b/win/C#/Functions/System.cs @@ -0,0 +1,56 @@ +/* System.cs $ + + This file is part of the HandBrake source code. + Homepage: . + It may be used under the terms of the GNU General Public License. */ + +using System; +using System.Windows.Forms; +using Microsoft.Win32; + +namespace Handbrake.Functions +{ + class SystemInfo + { + /// + /// Returns the total physical ram in a system + /// + /// + public static uint TotalPhysicalMemory + { + get + { + Win32.MEMORYSTATUS memStatus = new Win32.MEMORYSTATUS(); + Win32.GlobalMemoryStatus(ref memStatus); + + uint memoryInfo = memStatus.dwTotalPhys; + memoryInfo = memoryInfo/1024/1024; + + return memoryInfo; + } + } + + /// + /// Get the number of CPU Cores + /// + /// Object + public static Object GetCpuCount + { + get + { + RegistryKey regKey = Registry.LocalMachine; + regKey = regKey.OpenSubKey("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0"); + return regKey == null ? 0 : regKey.GetValue("ProcessorNameString"); + } + } + + /// + /// Get the System screen size information. + /// + /// System.Windows.Forms.Scree + public static Screen ScreenBounds + { + get { return Screen.PrimaryScreen; } + } + } +} -- cgit v1.2.3