unit memory;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br> Dialogs, SUIButton, StdCtrls, SUIMemo, ExtCtrls, SUIForm;<br><br>type<br> TForm_mem = class(TForm)<br> suiForm1: TsuiForm;<br> GroupBox1: TGroupBox;<br> suiMemo1: TsuiMemo;<br> suiButton1: TsuiButton;<br> suiButton2: TsuiButton;<br> procedure suiButton1Click(Sender: TObject);<br> procedure suiButton2Click(Sender: TObject);<br> private<br> { Private declarations }<br> public<br> { Public declarations }<br> end;<br><br>var<br> Form_mem: TForm_mem;<br><br>implementation<br><br>{$R *.dfm}<br><br>procedure TForm_mem.suiButton1Click(Sender: TObject);<br>var MemInfo: MEMORYSTATUS;<br>begin<br> // 获取内存信息<br> GlobalMemoryStatus(MemInfo);<br> suimemo1.Lines.Add(IntToStr(MemInfo.dwMemoryLoad) + '%的内存在使用');<br> suimemo1.Lines.Add('物理内存共有' + IntToStr(MemInfo.dwTotalPhys) + '字节');<br> suimemo1.Lines.Add('未使用的物理内存有' + IntToStr(MemInfo.dwAvailPhys) + '字节');<br> suimemo1.Lines.Add('交换文件的大小为' + IntToStr(MemInfo.dwTotalPageFile) + '字节');<br> suimemo1.Lines.Add('未使用的交换文件大小为' + IntToStr(MemInfo.dwAvailPageFile) + '字节');<br> suimemo1.Lines.Add('虚拟内存空间大小为' + IntToStr(MemInfo.dwTotalVirtual) + '字节');<br> suimemo1.Lines.Add('未使用的虚拟内存大小为' + IntToStr(MemInfo.dwAvailVirtual) + '字节');<br>end;<br><br>procedure TForm_mem.suiButton2Click(Sender: TObject);<br>begin<br> close;<br>end;