unit about;

interface

uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls,
  Buttons, ExtCtrls, ComCtrls;

type
  TAboutBox = class(TForm)
    OKButton: TButton;
    PageControl1: TPageControl;
    TabSheet1: TTabSheet;
    Panel1: TPanel;
    ProgramIcon: TImage;
    ProductName: TLabel;
    Version: TLabel;
    Copyright: TLabel;
    Comments: TLabel;
    TabSheet2: TTabSheet;
    Memo1: TMemo;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure Label2Click(Sender: TObject);
    procedure Label2MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Label2MouseUp(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

  type lplp = ^Pointer;
  
function GetFileVersionInfoSize2(lptstrFilename: PAnsiChar; lpdwHandle: LPDWORD): DWORD; stdcall;
function GetFileVersionInfo2(lptstrFilename: PAnsiChar; dwHandle : DWORD; dwLen: DWORD; lpData: Pointer): BOOL; stdcall;
function VerQueryValue2(pBlock: Pointer; lpSubBlock: PAnsiChar; lplpBuffer: lplp; puLen: pUINT): BOOL; stdcall;

var
  AboutBox: TAboutBox;

implementation

uses ShellAPI, ex2explore, Dialogs;

{$R *.DFM}

const
  version   = 'version.dll';

function VerQueryValue2; external version name 'VerQueryValueA';
function GetFileVersionInfoSize2; external version name 'GetFileVersionInfoSizeA';
function GetFileVersionInfo2; external version name 'GetFileVersionInfoA';


procedure TAboutBox.FormClose(Sender: TObject; var Action: TCloseAction);
begin
   Action := caFree;
end;

procedure TAboutBox.Label2Click(Sender: TObject);
begin
   ShellExecute(Handle, 'open', PChar(TLabel(Sender).Caption), nil, nil, SW_SHOWNORMAL)
end;

procedure TAboutBox.Label2MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
   Label2.Font.Color := clRed;
end;

procedure TAboutBox.Label2MouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
   Label2.Font.Color := clBlue;
end;

procedure TAboutBox.FormCreate(Sender: TObject);
{var
   Handle         : DWORD;
   BufferSize     : DWORD;
   VersionInfo    : String;
   ProductVersion : String;
   BufferLen      : UInt;
   BufferPtr      : Pointer;}
begin
   Version.Caption := 'Version ' + Explore2fsVersion;
{   BufferSize := GetFileVersionInfoSize2(PChar(Application.ExeName), @Handle);
   SetLength(VersionInfo, BufferSize);
   if not GetFileVersionInfo2(PChar(Application.ExeName), 0, BufferSize, PChar(VersionInfo)) then
   begin
      MessageDlg('Error ' + IntToStr(GetLastError) + ' retrieving version information', mtError, [mbOK], 0);
   end
   else
   begin
      BufferLen := 256;
      SetLength(ProductVersion, BufferLen);
      BufferPtr := PChar(ProductVersion);
      VerQueryValue2(PChar(VersionInfo), '\StringFileInfo\040904E4\ProductVersion', @BufferPtr, @BufferLen);
   end;}

end;
{
    explore2fs, the Linux file system utiltiy for Windows NT
    Copyright (C) 1998  John Newbigin

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
}

end.

