summaryrefslogtreecommitdiffstats
path: root/win/C#/Functions/SystemInfo.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2008-08-09 18:59:33 +0000
committersr55 <[email protected]>2008-08-09 18:59:33 +0000
commit4be456c1c6b177a1774a8c998d3ac39c94292057 (patch)
treecf3a70f260d81ea9494d6a35b780499a9187b085 /win/C#/Functions/SystemInfo.cs
parente5bfe9599b4f572c43f8508199f2731e58edec5c (diff)
WinGui:
- Added Memory and screen bounds to the activity log. - Removed some x264 code from frmMain. The x264 widgets are now populated from the designer file. - Removed some duplicate code from x264Panel.cs - Added the macgui's animate function to x264Panel.cs - Setup the Audio panel to default the sample rate to audio on audio track change. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1621 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Functions/SystemInfo.cs')
-rw-r--r--win/C#/Functions/SystemInfo.cs57
1 files changed, 57 insertions, 0 deletions
diff --git a/win/C#/Functions/SystemInfo.cs b/win/C#/Functions/SystemInfo.cs
new file mode 100644
index 000000000..0b7457324
--- /dev/null
+++ b/win/C#/Functions/SystemInfo.cs
@@ -0,0 +1,57 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+using System.Net;
+using System.IO;
+using System.Diagnostics;
+using System.Threading;
+using System.Runtime.InteropServices;
+using System.Globalization;
+
+namespace Handbrake.Functions
+{
+ class SystemInfo
+ {
+ #region CheckRam
+ private struct MEMORYSTATUS
+ {
+ public UInt32 dwLength;
+ public UInt32 dwMemoryLoad;
+ public UInt32 dwTotalPhys; // Used
+ public UInt32 dwAvailPhys;
+ public UInt32 dwTotalPageFile;
+ public UInt32 dwAvailPageFile;
+ public UInt32 dwTotalVirtual;
+ public UInt32 dwAvailVirtual;
+ }
+
+ [DllImport("kernel32.dll")]
+ private static extern void GlobalMemoryStatus
+ (
+ ref MEMORYSTATUS lpBuffer
+ );
+
+
+ /// <summary>
+ /// Returns the total physical ram in a system
+ /// </summary>
+ /// <returns></returns>
+ public uint TotalPhysicalMemory()
+ {
+ MEMORYSTATUS memStatus = new MEMORYSTATUS();
+ GlobalMemoryStatus(ref memStatus);
+
+ uint MemoryInfo = memStatus.dwTotalPhys;
+ MemoryInfo = MemoryInfo / 1024 / 1024;
+
+ return MemoryInfo;
+ }
+ #endregion
+
+ }
+}