引用ShellAPI 里边有几个函数,我想应该可以SHGetFileInfo,SHGetFileInfoA,SHGetFileInfoW但我试了一下,只得到了一些没什么用的信息 procedure getshellinfo(a:tfilename;var name,typ:string;var attr:integer); var info : tshfileinfo; begin fillchar(info,sizeof(tshfileinfo),0); shgetfileinfo(pchar(a),0,info,sizeof(info),shgfi_displayname or shgfi_typename or shgfi_icon or shgfi_attributes); with info do begin name := szdisplayname; typ := sztypename; attr := dwattributes; end; end;procedure TForm1.Button1Click(Sender: TObject); var name,typ:string; attr:integer; begin getshellinfo('E:\AA.doc', name,typ,icon,attr) ; showmessage(name); showmessage(typ); end;
里边有几个函数,我想应该可以SHGetFileInfo,SHGetFileInfoA,SHGetFileInfoW但我试了一下,只得到了一些没什么用的信息
procedure getshellinfo(a:tfilename;var name,typ:string;var attr:integer);
var
info : tshfileinfo;
begin
fillchar(info,sizeof(tshfileinfo),0);
shgetfileinfo(pchar(a),0,info,sizeof(info),shgfi_displayname or shgfi_typename or
shgfi_icon or shgfi_attributes);
with info do begin
name := szdisplayname;
typ := sztypename;
attr := dwattributes;
end;
end;procedure TForm1.Button1Click(Sender: TObject);
var
name,typ:string;
attr:integer;
begin
getshellinfo('E:\AA.doc', name,typ,icon,attr) ;
showmessage(name);
showmessage(typ);
end;