Source Code



Get System Information Resource

  • anonymous
  • Jan 16' 14
  • Delphi
  • 189
  • 192
  • United States

unit main;

interface

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

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Label1: 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

Memo1.Lines.Clear;

MemoryStatus.dwLength := SizeOf(MemoryStatus);

GlobalMemoryStatus(MemoryStatus);

with MemoryStatus do
begin
// Mengetahui ukuran TMemoryStatus
   Memo1.Lines.Add(IntToStr(dwLength) +
                   ' Size of ''MemoryStatus'' record');
// Persentase memori yg dipakai oleh system
   Memo1.Lines.Add(IntToStr(dwMemoryLoad) + '% memory in use');
// Jumlah Total Physical memory yang dialokasikan
   Memo1.Lines.Add(IntToStr(dwTotalPhys) +
                   ' Total Physical Memory in bytes');
// Jumlah yang tersisa dari physical memory
   Memo1.Lines.Add(IntToStr(dwAvailPhys) +
                   ' Available Physical Memory in bytes');
// Jumlah total byte yg dialokasikan ke page file anda.
   Memo1.Lines.Add(IntToStr(dwTotalPageFile) +
                   ' Total Bytes of Paging File');
// Jumlah total byte yg tersisa pada page file anda
   Memo1.Lines.Add(IntToStr(dwAvailPageFile) +
                   ' Available bytes in paging file');
// Jumlah byte ttal yg dialokasikan untuk program
// Total memori virtual
   Memo1.Lines.Add(IntToStr(dwTotalVirtual) +
                   ' User Bytes of Address space');
// The amount of avalable bytes that is left to your program to use.
   Memo1.Lines.Add(IntToStr(dwAvailVirtual) +
                   ' Available User bytes of address space');
end; // with
end; // procedure

end.
  • Tags : system, information
comments powered by Disqus

Related Code

Get Current Date System

enable and disable system beep

Drive Info

Getting System Power Information



Category

Tag Linked