unit About;

interface

uses Windows, SysUtils, ShellAPI, Classes, Graphics, Forms, Controls, StdCtrls,
  Buttons, ExtCtrls, MiscRoutines, SharedData, SharedCode;

type
  TAboutBox = class(TForm)
    Panel1: TPanel;
    OKButton: TButton;
    Copyright2: TLabel;
    Bevel1: TBevel;
    TechSuppBtn: TButton;
    Bevel2: TBevel;
    OsLabel: TLabel;
    ProgramName: TLabel;
    Panel2: TPanel;
    Image: TImage;
    Bevel3: TBevel;
    Label4: TLabel;
    Label5: TLabel;
    GoHome: TLabel;
    procedure FormShow(Sender: TObject);
    procedure TechSuppBtnClick(Sender: TObject);
    procedure GoHomeClick(Sender: TObject);
  end;

var
  AboutBox: TAboutBox;

implementation

{$R *.DFM}

procedure TAboutBox.FormShow(Sender: TObject);
var
  vi : TOsVersionInfo;
  ms : TMemoryStatus;
  s : string;
begin
//  ProgramName.Caption:=StrAppName;
  memZeroMemory(@vi,sizeof(vi));
  vi.dwOSVersionInfoSize:=sizeof(vi);
  GetVersionEx(vi);
  s:='Физическая память, доступная ';
  if(vi.dwPlatformId=VER_PLATFORM_WIN32_NT) then
    s:=s+'NT '
  else
    s:=s+'Windows ';
  s:=s+Format('%d.%d',[vi.dwMajorVersion,vi.dwMinorVersion])+':  ';
  memZeroMemory(@ms,sizeof(ms));
  ms.dwLength:=sizeof(ms);
  GlobalMemoryStatus(ms);
  if ms.dwTotalPhys > 0 then
    s := s + IntToStr(Trunc(ms.dwTotalPhys/1024)) + ' Кб.'
  else
    s := s + ' очень много.';
  OsLabel.Caption := s;
end;

procedure TAboutBox.TechSuppBtnClick(Sender: TObject);
begin
  Help(HELP_CONTEXT,IDH_TECHSUPPORT);
end;



procedure TAboutBox.GoHomeClick(Sender: TObject);
begin
  ShellExecute(Handle,'open',
    'http://sleepgate.ru/devel/gradient',
    nil,nil,SW_SHOWNORMAL);
end;

end.

