//主窗体
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ComCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
StatusBar1: TStatusBar;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses About;
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
aboutbox.showmodal;
end;
end.
//About窗体
{=============通用About
程序源代码=============}
{ }
{ _/\_/\__ Copyright by 梁 明 __/\_/\_ }
{ 1998-01-02 }
{ }
{=============================================}
unit About;
interface
uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls,
Buttons, ExtCtrls,Dialogs;
type
TAboutBox = class(TForm)
Panel1: TPanel;
ProgramIcon: TImage;
ProductName: TLabel;
Version: TLabel;
Copyright: TLabel;
others: TLabel;
Author: TPaintBox;
BitBtn1: TBitBtn;
Bevel1: TBevel;
lblOs: TLabel;
lblMemory: TLabel;
procedure FormCreate(Sender: TObject);
procedure ProgramIconClick(Sender: TObject);
procedure OKButtonClick(Sender: TObject);
procedure FormKeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
s:string;
Procedure Delay(x,y:word);//延时
程序 procedure GetOSInfo; //系统信息
程序 Procedure GetMemoryInfo ; //可用资源
程序 public
{ Public declarations }
end;
var
AboutBox: TAboutBox;
implementation
{$R *.DFM}
Procedure TAboutBox.GetMemoryInfo ;//可用资源
var
MS: TMemoryStatus;
begin
MS.dwLength := SizeOf(TMemoryStatus);
GlobalMemoryStatus(MS);
lblMemory.Caption :=lblMemory.Caption +FormatFloat(''#,###" KB"'', MS.dwTotalPhys div 1024);
end;
procedure TAboutBox.GetOSInfo; //获取系统信息
var
Platform: string;
BuildNumber: Integer;
begin
case Win32Platform of
VER_PLATFORM_WIN32_WINDOWS:
begin
Platform := ''Windows 95'';
BuildNumber := Win32BuildNumber and $0000FFFF;
end;
VER_PLATFORM_WIN32_NT:
begin
Platform := ''Windows NT'';
BuildNumber := Win32BuildNumber;
end;
else
begin
Platform := ''Windows'';
BuildNumber := 0;
end;
end;
if (Win32Platform = VER_PLATFORM_WIN32_WINDOWS) or
(Win32Platform = VER_PL