uses
ShellAPI;
function geticon(filepath:string):ticon;
var
ico:ticon;
begin
if not FileExists(FilePath) then begin ShowMessage('文件不存在'); Exit; end;
ico := TIcon.Create;
ico.Handle:=ExtractIcon(HInstance, PChar(FilePath), 0);
result:=ico;
//ico.Free;
end;
文章標籤
全站熱搜