unit1.pas
来自「delhpi经典游戏程序设计40例,大家不防下载看看.源码全在项目文件里!」· PAS 代码 · 共 40 行
PAS
40 行
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
MemInfo:MEMORYSTATUS;
begin
GlobalMemoryStatus(MemInfo);
Memo1.Lines.Add(InttoStr(MemInfo.dwMemoryLoad)+'%的内存在使用');
Memo1.Lines.Add('物理内存共有'+IntToStr(MemInfo.dwTotalPhys)+'字节');
Memo1.Lines.Add('未使用的物理内存有'+IntToStr(MemInfo.dwAvailPhys)+'字节');
Memo1.Lines.Add('交换文件的大小'+IntToStr(MemInfo.dwTotalPageFile)+'字节');
Memo1.Lines.Add('未使用的交换文件的大小'+IntToStr(MemInfo.dwAvailPageFile)+'字节');
end;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?