unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ExtCtrls, AHMSystemClass, AHMTDriveDetails;
{$I AHM.INC}
type
  TForm1 = class(TForm)
    AHMDriveDetails1: TAHMDriveDetails;
    ComboBox1: TComboBox;
    Panel1: TPanel;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    procedure FormCreate(Sender: TObject);
    procedure AHMDriveDetails1Update(Sender: TObject);
    procedure ComboBox1Change(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
begin
  Combobox1.Items:=AHMDriveDetails1.Drives;
  Combobox1.ItemIndex:=Combobox1.Items.IndexOf('C:\');
  AHMDriveDetails1.SetDriveDetails(Combobox1.Text);

end;

procedure TForm1.AHMDriveDetails1Update(Sender: TObject);
begin
  with AHMDriveDetails1 do
  begin
    Label1.Caption:='Volume Label : '+VolumeLabel;
    Label2.Caption:='Drive Serialnumber : '+Serialnumber;
    Label3.Caption:='Drive System : '+Systemname;
    {$IFDEF AHMINPRISE4}
    Label5.Caption:='Used Bytes : '+UsedBytes;
    Label6.Caption:='Free Bytes : '+FreeBytes;
    Label7.Caption:='Total Bytes : '+TotalBytes;
    {$ENDIF}
    Label8.Caption:='Max. Filename Length : '+Inttostr(MaxFilesLength);
  end;
end;

procedure TForm1.ComboBox1Change(Sender: TObject);
begin
  AHMDriveDetails1.SetDriveDetails(Combobox1.Text);
end;

end.
