怎样在ListView1显示文件的系统图标?(50分)

C

caoliu

Unregistered / Unconfirmed
GUEST, unregistred user!
例如:
一个ShellListView1,一个ListView1,一个BitBtn1;
BitBtn1 onclick:
选中ShellListView1里几个文件,将选中的文件名和路经copy到ListView1;
但怎样在ListView1显示文件原来的图标(文件在windows中显示的图标)?

thanks!
 
说明白一点行吗?
或留下qq和mail
 
选中ShellListView1里几个文件;
BitBtn1 onclick:
将选中的文件的文件名和路经列到ListView1中;
这时ListView1中的文件的图标怎么和ShellListView1文件一样?

tidecl@vip.sina.com
 
我这里写了两个函数你可以看一看了
function TFrm_Main.GetNormalIcon(Path:String):Hicon;
const
Flags=SHGFI_ICON or SHGFI_SMALLICON;//获得小图标还有一些值你可以看一下相关的帮助文件
var
FileInFo:TSHFileInFo;
begin
SHGetFileInFo(Pchar(Path), 0, FileInFo,SizeOf(FileInFo), Flags);
Result:=FileInFo.Hicon;
end;
 
接受答案了.
 
顶部