Source Code



Memory and Percentage

  • anonymous
  • Jan 16' 14
  • Delphi
  • 140
  • 220
  • United States
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Button1: TButton;
    Label2: TLabel;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
var
  MemoryStatus: TMemoryStatus;
begin
  MemoryStatus.dwLength := sizeof(MemoryStatus);
  GlobalMemoryStatus(MemoryStatus);
  Label1.Caption := 'Total Physical Memory : ' +
  IntToStr(MemoryStatus.dwTotalPhys)+ ' bytes';
  Label2.Caption := 'Percent Memory : ' +
  IntToStr(MemoryStatus.dwMemoryLoad)+ ' %';
end;

end.
  • Tags : memory
comments powered by Disqus



Category