下面这段代码来源于一本DELPHI学习的书上,运行测试通过,但发现一个重要问题,为什么当我查找'*12*'这样的通配符时(当然也可以不是12,只是举例),出现找到的文件有一些并非包括'12',当然12的也全出来,比如查到的文件有MMSBar_MobileQQ.ico这样一些,后来我把这些文件移到另一个文件内,就查不出来了,难道这些跟路径有关吗,MMSBar_MobileQQ.ico文件在QQ安装目录中的一个子目录中,一点问题也没有啊,哪位高人帮我看看,我急切想知道答案,谢谢,分多多给 
unit Unit1;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, FileCtrl;type
  TForm1 = class(TForm)
    DirectoryListBox1: TDirectoryListBox;
    LabeledEdit1: TLabeledEdit;
    Button1: TButton;
    ListBox1: TListBox;
    DriveComboBox1: TDriveComboBox;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
  procedure findfiles(apath:string;afile:string);
    { Public declarations }
  end;var
  Form1: TForm1;
   Targetfiles:string;
implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
begin
screen.Cursor:=crHourGlass;
try
listbox1.Clear;
TargetFiles:=LabeledEdit1.text;
findfiles(Directorylistbox1.Directory,Targetfiles);
finally
screen.Cursor:=crdefault;
end;
end;
procedure tform1.findfiles(apath,afile:string);
var
findresult:integer;
fsearchrec,dsearchrec:Tsearchrec;
function isDirnotation(adirname:string):boolean;
begin
result:=((adirname='.') or (adirname='..'));
end;
begin
if apath[Length(apath)]<>'\' then
apath:=apath+'\';
findresult:=findfirst(apath+afile,faAnyFile+faHidden+faSysFile+faReadOnly,fsearchrec);
try
while findresult=0 do begin
listbox1.items.Add(fsearchrec.name);
findresult:=findnext(fsearchrec);
end;
findresult:=findfirst(apath+'*.*',fadirectory,dsearchrec);
while findresult=0 do begin
if((DSearchrec.Attr and fadirectory)= fadirectory) and
not isdirnotation(dsearchrec.name) then
findfiles(apath+dsearchrec.Name,targetfiles);
findresult:=findnext(dsearchrec);
end;
finally
findclose(fsearchrec);
end;end;procedure TForm1.Button2Click(Sender: TObject);
begin
listbox1.Items.add('aa');
end;
end.