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);
    procedure ImageDblClick(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);
  memZeroMemory(@ms,sizeof(ms));
  ms.dwLength:=sizeof(ms);
  GlobalMemoryStatus(ms);
  if ms.dwTotalPhys > 0 then
  begin
    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])+':  ';
    s := s + IntToStr(Trunc(ms.dwTotalPhys/1024)) + ' Кб.'
  end
  else
    s := 'Host OS: 64-bit NT ' +
      Format('%d.%d',[vi.dwMajorVersion,vi.dwMinorVersion]) +
      ', and a lot of memory.';
  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://www.libv.org',nil,nil,SW_SHOWNORMAL);
end;

procedure TAboutBox.ImageDblClick(Sender: TObject);
begin
  ShellExecute(Handle, 'open',
    'http://libv.org/gradient', nil, nil, SW_SHOWNORMAL);
end;

end.

