unit U_About;

interface

uses
  Windows, U_LNG, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  ShellAPI, Dialogs, StdCtrls, ExtCtrls, ComCtrls, siComp, siLngLnk,
  EnJpgGr;

const
  {$IF Defined (SCS_RF)}
    {$IF Defined(SCS_PANDUIT)}
      URL = '';//'www.cableproject.net';
      eMail = '';//'office@cableproject.net';
    {$ELSE}
      URL = 'www.expertsoft.ru';
      eMail = 'info@expertsoft.ru';
      Tel = '+7 (495) 543-7-618';
    {$IFEND}  
  {$ELSE}
    {$IF Defined(SCS_PE)}
      {$IF Defined(SCS_PANDUIT)}
        URL = '';//'www.cableproject.net';
        eMail = '';//'office@cableproject.net';
      {$ELSE}
        URL = 'www.cableproject.net';
        eMail = 'office@cableproject.net';
      {$IFEND}
      Tel = '';//'(044) 360 9 111';
    {$ELSEIF Defined(SCS_SPA)}
      URL = 'www.telcocad.net';
      eMail = 'office@telcocad.net';
      Tel = '';
    {$ELSE}
      URL = 'www.expertsoft.com.ua';
      eMail = 'office@expertsoft.com.ua';
      Tel = '(044) 360 9 111';
    {$IFEND}
  {$IFEND}

type
  TF_About = class(TForm)
    ImageSCS: TImage;
    lng_Forms: TsiLangLinked;
    ImageTELECOM: TImage;
    ImageSCS_PE: TImage;
    lblWeb: TLabel;
    lblVersion: TLabel;
    lblTelephone: TLabel;
    lblProgID: TLabel;
    lblEmail: TLabel;
    lblCaptionProgID: TLabel;
    ImageSCS_SPA: TImage;
    ImageSCS_Panduit: TImage;
    procedure FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure lblWebClick(Sender: TObject);
    procedure lblEmailClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure ImageSCSClick(Sender: TObject);
    procedure lblEmailMouseEnter(Sender: TObject);
    procedure lblEmailMouseLeave(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  F_About: TF_About;

implementation

uses U_Common, U_Main, U_Protection, U_ProtectionCommon;

{$R *.dfm}


procedure OpenUrl(s: string='');
var
  SHI : TShellExecuteInfo;
begin
  try
    ZeroMemory(@SHI, sizeof(SHI));
    SHI.cbSize := sizeof(SHI);
    SHI.fMask := SEE_MASK_NOCLOSEPROCESS;
    SHI.Wnd := Application.Handle;
    SHI.lpVerb := PChar('Open');
    if s = '' then
      SHI.lpFile := PChar(URL)
    else
      SHI.lpFile := PChar(s);
    SHI.lpParameters := nil;
    SHI.lpDirectory := nil;
    ShellExecuteEx(@SHI);
  except

  end;
end;

procedure OpenMail(s: string='');
var
  SHI : TShellExecuteInfo;
  tmpstr: string;
begin
  try
    ZeroMemory(@SHI, sizeof(SHI));
    SHI.cbSize := sizeof(SHI);
    SHI.fMask := SEE_MASK_NOCLOSEPROCESS;
    SHI.Wnd := Application.Handle;
    SHI.lpVerb := PChar('Open');
    if s = '' then
      SHI.lpFile := PChar('mailto:' + eMail)
    else
    begin
      tmpstr := 'mailto:' + s;
      SHI.lpFile := PChar(tmpstr);
    end;
    SHI.lpParameters := nil;
    SHI.lpDirectory := nil;
    ShellExecuteEx(@SHI);
  except

  end;
end;

procedure TF_About.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if Key = VK_ESCAPE then
    ModalResult := mrOk;
  if Key = VK_RETURN then
    ModalResult := mrOk;
end;

procedure TF_About.lblWebClick(Sender: TObject);
begin
  OpenUrl;
end;

procedure TF_About.lblEmailClick(Sender: TObject);
begin
  OpenMail;
end;

procedure TF_About.FormCreate(Sender: TObject);
var
  s: string;
begin
  try
    lblVersion.Caption := VersionEXE;
    s := ProgID.Data1 + '-' + ProgID.Data2 + '-' +
                      ProgID.Data3 + '-' + ProgID.Data4 + '-' + DateID;
    lblProgID.Caption := FormatForUser(s);
  except
  end;
end;

procedure TF_About.ImageSCSClick(Sender: TObject);
begin
  ModalResult := mrOk;
end;

procedure TF_About.lblEmailMouseEnter(Sender: TObject);
begin
  TLabel(Sender).Font.Style := TLabel(Sender).Font.Style + [fsUnderline];
end;

procedure TF_About.lblEmailMouseLeave(Sender: TObject);
begin
  TLabel(Sender).Font.Style := TLabel(Sender).Font.Style - [fsUnderline];
end;

procedure TF_About.FormShow(Sender: TObject);
begin
  lblTelephone.Caption := Tel;

  {$IF Defined(TELECOM)}
    imageSCS.Visible  := False;
    imageTelecom.visible := True;
    ImageSCS_PE.Visible := False;
    ImageSCS_Panduit.Visible := False;
  {$ELSEIF Defined(SCS_PE)}
    imageSCS.Visible  := False;
    imageTelecom.visible := False;
    {$IF Defined(SCS_PANDUIT)}
      lblVersion.Visible := False;
      ImageSCS_PE.Visible := False;
      ImageSCS_Panduit.Visible := True;
    {$ELSE}
      ImageSCS_PE.Visible := True;
      ImageSCS_Panduit.Visible := False;
    {$IFEND}
    lblProgID.Font.Color := clBlack;
  {$ELSEIF Defined(SCS_SPA)}
    imageSCS.Visible  := False;
    imageTelecom.visible := False;
    ImageSCS_PE.Visible := False;
    ImageSCS_SPA.Visible := True;
    ImageSCS_Panduit.Visible := False;
    lblProgID.Font.Color := clBlack;
  {$ELSE}
    {$IF Defined(SCS_PANDUIT)}
      imageSCS.Visible  := False;
      imageTelecom.visible := False;
      ImageSCS_PE.Visible := False;
      ImageSCS_Panduit.Visible := True;
    {$ELSE}
      imageSCS.Visible := True;
      imageTelecom.visible := False;
      ImageSCS_PE.Visible := False;
      ImageSCS_Panduit.Visible := False;
    {$IFEND}  
  {$IFEND}
  
end;

end.
