unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ImageEnView, IEMView, StdCtrls, FileCtrl, ImageEnIO, ComCtrls;

type
  TForm1 = class(TForm)
    GroupBox1: TGroupBox;
    DriveComboBox1: TDriveComboBox;
    DirectoryListBox1: TDirectoryListBox;
    ImageEnMView1: TImageEnMView;
    StatusBar1: TStatusBar;
    procedure DirectoryListBox1Change(Sender: TObject);
    procedure FormActivate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

uses GIFLZW, TIFLZW;

{$R *.DFM}

procedure TForm1.DirectoryListBox1Change(Sender: TObject);
var
	sr:TSearchRec;
   Found,idx:integer;
   fpath:string;
begin
	ImageEnMView1.Clear;
	Found:=FindFirst(DirectoryListBox1.Directory+'\*.*',faArchive,sr);
   while Found=0 do begin
   	fpath:=DirectoryListBox1.Directory+'\'+sr.Name;
   	if FindFileFormat(fpath,true)<>ioUnknown then begin
         idx:=ImageEnMView1.AppendImage;
         ImageEnMView1.ImageFileName[idx]:=fpath;
      end;
   	//
      Found:=FindNext(sr);
   end;
   FindClose(sr);
end;

procedure TForm1.FormActivate(Sender: TObject);
begin
   DefGIF_LZWDECOMPFUNC:=GIFLZWDecompress;
   DefGIF_LZWCOMPFUNC:=GIFLZWCompress;
   DefTIFF_LZWDECOMPFUNC:=TIFFLZWDecompress;
   DefTIFF_LZWCOMPFUNC:=TIFFLZWCompress;
end;

end.
