unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ExtCtrls, AHMSystemClass, AHMTFileDetails;

type
  TForm1 = class(TForm)
    AHMFileDetails1: TAHMFileDetails;
    OpenDialog1: TOpenDialog;
    Panel1: TPanel;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    Button1: TButton;
    Label9: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure AHMFileDetails1Update(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
  if OpenDialog1.Execute then
    AHMFileDetails1.SetFilename(OpenDialog1.Filename);
end;

procedure TForm1.AHMFileDetails1Update(Sender: TObject);
begin
  with AHMFileDetails1 do
  begin
    Label1.Caption:='File : '+AboutFile;
    Label2.Caption:='Attributes : '+AttribShort;
    Label3.Caption:='Company Name : '+CompanyName;
    Label4.Caption:='Creation Time : '+TimeToStr(CreationTime);
    Label5.Caption:='Product Name : '+ProductName;
    Label6.Caption:='Internal Name : '+InternalName;
    Label7.Caption:='Product Version : '+ProductVersion;
    Label8.Caption:='Last Access : '+TimeToStr(LastAccessTime);
    case FileType of
      tApplication: Label9.Caption:='File Type : Application';
      tDll: Label9.Caption:='File Type : Dynamic Link Library';
      tDriver: Label9.Caption:='File Type : Driver';
      tFont: Label9.Caption:='File Type : Font';
      tVXD: Label9.Caption:='File Type : VXD';
      tUnknown: Label9.Caption:='File Type : Unknown';
    end;
  end;
end;

end.
