Author: gedmurphy
Date: Mon Oct 2 22:51:31 2006
New Revision: 24366
URL:
http://svn.reactos.org/svn/reactos?rev=24366&view=rev
Log:
- display system RAM on the general page.
- fixes bug 1835
Modified:
trunk/reactos/dll/cpl/sysdm/general.c
trunk/reactos/dll/cpl/sysdm/precomp.h
Modified: trunk/reactos/dll/cpl/sysdm/general.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/general.c?re…
==============================================================================
--- trunk/reactos/dll/cpl/sysdm/general.c (original)
+++ trunk/reactos/dll/cpl/sysdm/general.c Mon Oct 2 22:51:31 2006
@@ -70,12 +70,32 @@
}
-DWORD WINAPI
+static VOID
GetSystemInformation(HWND hwnd)
{
- UNREFERENCED_PARAMETER(hwnd);
+ MEMORYSTATUS MemStat;
+ TCHAR Buf[32];
+ INT Ret = 0;
- return 0;
+ /* Get total physical RAM */
+ MemStat.dwLength = sizeof(MemStat);
+ GlobalMemoryStatus(&MemStat);
+
+ if (MemStat.dwTotalPhys < KB_DIV)
+ Ret = wsprintf(Buf, _T("%luKB of RAM"), MemStat.dwTotalPhys/1024);
+ else if (MemStat.dwTotalPhys >= KB_DIV && MemStat.dwTotalPhys <
GB_DIV)
+ Ret = wsprintf(Buf, _T("%luMB of RAM"), MemStat.dwTotalPhys/1048576);
+ else if (MemStat.dwTotalPhys > GB_DIV)
+ Ret = wsprintf(Buf, _T("%luGB of RAM"),
MemStat.dwTotalPhys/1073741824);
+
+ if (Ret)
+ {
+ SendDlgItemMessage(hwnd,
+ IDC_SYSTEMMEMORY,
+ WM_SETTEXT,
+ 0,
+ (LPARAM)Buf);
+ }
}
@@ -97,7 +117,7 @@
{
HWND hLink = GetDlgItem(hwndDlg, IDC_ROSHOMEPAGE_LINK);
- TextToLink(hLink,
+ TextToLink(hLink,
_T("http://www.reactos.org"),
NULL);
Modified: trunk/reactos/dll/cpl/sysdm/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/precomp.h?re…
==============================================================================
--- trunk/reactos/dll/cpl/sysdm/precomp.h (original)
+++ trunk/reactos/dll/cpl/sysdm/precomp.h Mon Oct 2 22:51:31 2006
@@ -11,6 +11,9 @@
#include "resource.h"
#define NUM_APPLETS (1)
+#define KB_DIV 1024
+#define MB_DIV 1048576
+#define GB_DIV 1.0737e9
typedef LONG (CALLBACK *APPLET_INITPROC)(VOID);