用DEPHI 3.0实现动画ABOUT窗口
【打印文章】
---- 一般系统的ABOUT窗口中都含有当前系统的信息(如:CPU类型,硬盘容量,内存容量等),一个标志系统的图标,一个OK按钮等内容。笔者在工作中用DEPHI
3.0实现了动画效果的ABOUT窗口。
一. 创建含有如下控件的窗体:
控件属性 值
FORM1 CAPTION 动画ABOUT窗口
ANIMATE1 COMMONAVI aviFindFolder
ACTIVEtrue
BUTTON1 CAPTION OK
LABEL1 CAPTION 通用进销存管理系统V3.0
LABEL2 CAPTION 版权所有:1997-1999年
LABEL3 CAPTION 物理内存总容量:
LABEL4 CAPTION 虚拟内存总容量:
LABEL5 CAPTION 可用虚拟内存容量:
LABEL6 CAPTION 硬盘容量:
LABEL7 CAPTION 硬盘可用容量:
LABEL8 CAPTION CPU类型:
LABEL9 CAPTION 显示器分辨率:
LABEL18 CAPTION 用物理内存:
LABEL11,LABEL12,LABEL13,
LABEL14,LABEL15,LABEL16,LABEL17
LABEL19 CAPTION 空
二.程序:
unit sysinfo;
interface
uses
Windows, Messages, SysUtils,
Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ComCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Animate1: TAnimate;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
Label14: TLabel;
Label15: TLabel;
Label16: TLabel;
Label17: TLabel;
Label18: TLabel;
Label19: TLabel;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
close;
end;
procedure TForm1.FormCreate(Sender: TObject);
var x,y:integer;
sysinfo:Tsysteminfo;
meminfo:Tmemorystatus;
c2,c3,c4,c5:integer;
begin
getsysteminfo(sysinfo);
label16.caption:=inttostr(sysinfo.dwProcessorType);
x:=getsystemmetrics(0);
y:=getsystemmetrics(1);
label17.caption:=inttostr(x)+'*'+inttostr(y);
globalmemorystatus(meminfo);
label11.caption:=inttostr(meminfo.dwTotalPhys)+'字节';
label19.caption:=inttostr(meminfo.dwAvailPhys)+'字节';
label12.caption:=inttostr(meminfo.dwTotalVirtual)+'字节';
label13.caption:=inttostr(meminfo.dwAvailVirTual)+'字节';
getdiskfreespace('c:\',c2,c3,c4,c5);
label14.caption:=inttostr(c5*c2*c3)+'字节';
label15.caption:=inttostr(c4*c2*c3)+'字节';
end;
end.
---- 以上程序在中文WINDOWS98,WINDOWS95,DEPHI 3.0软件环境下运行通过。
3.0实现了动画效果的ABOUT窗口。
一. 创建含有如下控件的窗体:
控件属性 值
FORM1 CAPTION 动画ABOUT窗口
ANIMATE1 COMMONAVI aviFindFolder
ACTIVEtrue
BUTTON1 CAPTION OK
LABEL1 CAPTION 通用进销存管理系统V3.0
LABEL2 CAPTION 版权所有:1997-1999年
LABEL3 CAPTION 物理内存总容量:
LABEL4 CAPTION 虚拟内存总容量:
LABEL5 CAPTION 可用虚拟内存容量:
LABEL6 CAPTION 硬盘容量:
LABEL7 CAPTION 硬盘可用容量:
LABEL8 CAPTION CPU类型:
LABEL9 CAPTION 显示器分辨率:
LABEL18 CAPTION 用物理内存:
LABEL11,LABEL12,LABEL13,
LABEL14,LABEL15,LABEL16,LABEL17
LABEL19 CAPTION 空
二.程序:
unit sysinfo;
interface
uses
Windows, Messages, SysUtils,
Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ComCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Animate1: TAnimate;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
Label14: TLabel;
Label15: TLabel;
Label16: TLabel;
Label17: TLabel;
Label18: TLabel;
Label19: TLabel;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
close;
end;
procedure TForm1.FormCreate(Sender: TObject);
var x,y:integer;
sysinfo:Tsysteminfo;
meminfo:Tmemorystatus;
c2,c3,c4,c5:integer;
begin
getsysteminfo(sysinfo);
label16.caption:=inttostr(sysinfo.dwProcessorType);
x:=getsystemmetrics(0);
y:=getsystemmetrics(1);
label17.caption:=inttostr(x)+'*'+inttostr(y);
globalmemorystatus(meminfo);
label11.caption:=inttostr(meminfo.dwTotalPhys)+'字节';
label19.caption:=inttostr(meminfo.dwAvailPhys)+'字节';
label12.caption:=inttostr(meminfo.dwTotalVirtual)+'字节';
label13.caption:=inttostr(meminfo.dwAvailVirTual)+'字节';
getdiskfreespace('c:\',c2,c3,c4,c5);
label14.caption:=inttostr(c5*c2*c3)+'字节';
label15.caption:=inttostr(c4*c2*c3)+'字节';
end;
end.
---- 以上程序在中文WINDOWS98,WINDOWS95,DEPHI 3.0软件环境下运行通过。
本栏文章均来自于互联网,版权归原作者和各发布网站所有,本站收集这些文章仅供学习参考之用。任何人都不能将这些文章用于商业或者其他目的。( Pfan.cn )
【编程爱好者论坛】