Arbeitsspeicher und Prozessorgeschwindigkeit anzeigen
-
Hallo,
ich möchte gerne die Größe des Arbeitsspeichers und die Prozessorgeschwindigkeit anzeigen lassen, den RAM in MB, die Prozessorg. in Megahertz.
Womit kann man das wohl realisieren?
MfG
DD
-
zum Arbeitsspeicher:
http://cpp-programming.de/page/quellcodes/viewcode.php?id=001zur Prozessorgeschwindigkeit:
http://cpp-programming.de/page/quellcodes/viewcode.php?id=037
-
Hallo
#include <vcl.h>
#include <iostream.h>
#include <shellapi.h>
#pragma hdrstop
#include <mmsystem.h>
#include <stdlib.h>
#include <dos.h>
#include <registry.hpp>void __fastcall TForm2::Timer1Timer(TObject *Sender)
{MEMORYSTATUS speicher;
speicher.dwLength = sizeof(speicher);GlobalMemoryStatus(&speicher);
Label1->Caption = String((float)speicher.dwMemoryLoad) + " Prozesse";
C2->Progress = speicher.dwMemoryLoad;
int W = speicher.dwTotalPhys / 1024;
Label2->Caption = String((int)(speicher.dwTotalPhys / 1024)) + " K Total";
C3->MaxValue = speicher.dwTotalPhys;
C3->Progress = speicher.dwTotalPhys;
int Z = speicher.dwAvailPhys / 1024;
Label3->Caption = String((int)(speicher.dwAvailPhys / 1024)) + " K Frei";
C1->MaxValue = speicher.dwTotalPhys;
C1->Progress = speicher.dwAvailPhys;
CGauge1->MaxValue = speicher.dwTotalPhys;
CGauge1->Progress = speicher.dwTotalPhys - speicher.dwAvailPhys;
Label24->Caption = String((int)(W - Z)) + " K Fest";int B = speicher.dwTotalVirtual / 1048576.0;
Label4->Caption = String((int)(speicher.dwTotalVirtual / 1048576.0)) + " MB Total";
C4->MaxValue = speicher.dwTotalVirtual;
C4->Progress = speicher.dwTotalVirtual;
int M = speicher.dwAvailVirtual / 1048576.0;
Label5->Caption = String((int)(speicher.dwAvailVirtual / 1048576.0)) + " MB Frei";
C5->MaxValue = speicher.dwTotalVirtual;
C5->Progress = speicher.dwAvailVirtual;
CGauge2->MaxValue = speicher.dwTotalVirtual;
CGauge2->Progress = speicher.dwTotalVirtual - speicher.dwAvailVirtual;
Label25->Caption = String((float)(B - M)) + " MB Fest";int T = speicher.dwTotalPageFile / 1048576.0;
Label6->Caption = String((int)(speicher.dwTotalPageFile / 1048576.0)) + " MB Total";
C6->MaxValue = speicher.dwTotalPageFile;
C6->Progress = speicher.dwTotalPageFile;
int P = speicher.dwAvailPageFile / 1048576.0;
Label7->Caption = String((int)(speicher.dwAvailPageFile / 1048576.0)) + " MB Frei";
C7->MaxValue = speicher.dwTotalPageFile;
C7->Progress = speicher.dwAvailPageFile;
CGauge3->MaxValue = speicher.dwTotalPageFile;
CGauge3->Progress = speicher.dwTotalPageFile - speicher.dwAvailPageFile;
Label26->Caption = String((int)(T - P)) + " MB Fest";
}