summaryrefslogtreecommitdiffstats
path: root/win/C#/Functions
diff options
context:
space:
mode:
authorsr55 <[email protected]>2010-01-09 20:44:10 +0000
committersr55 <[email protected]>2010-01-09 20:44:10 +0000
commitd655bd1bda60d6390428cf05de1e247e38fa1905 (patch)
tree217b910b87d781bc9da9927c25f75c94fb26c236 /win/C#/Functions
parenta7bc400d8ee9d45a0b0de3cadb2e0fb8060511a6 (diff)
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
Diffstat (limited to 'win/C#/Functions')
-rw-r--r--win/C#/Functions/System.cs56
1 files changed, 56 insertions, 0 deletions
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: <http://handbrake.fr>.
+ 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
+ {
+ /// <summary>
+ /// Returns the total physical ram in a system
+ /// </summary>
+ /// <returns></returns>
+ 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;
+ }
+ }
+
+ /// <summary>
+ /// Get the number of CPU Cores
+ /// </summary>
+ /// <returns>Object</returns>
+ public static Object GetCpuCount
+ {
+ get
+ {
+ RegistryKey regKey = Registry.LocalMachine;
+ regKey = regKey.OpenSubKey("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0");
+ return regKey == null ? 0 : regKey.GetValue("ProcessorNameString");
+ }
+ }
+
+ /// <summary>
+ /// Get the System screen size information.
+ /// </summary>
+ /// <returns>System.Windows.Forms.Scree</returns>
+ public static Screen ScreenBounds
+ {
+ get { return Screen.PrimaryScreen; }
+ }
+ }
+}