var
shfileinfo:tshfileinfo;
icon:ticon;
begin
icon := ticon.create;
try
if opendialog1.execute then
begin
shgetfileinfo(pchar(opendialog1.filename),0,shfileinfo,sizeof(tshfileinfo),
shellapi.shgfi_icon or shellapi.shgfi_smallicon or shellapi.shgfi_typename);
icon.handle := shfileinfo.hicon;
self.p_w_picpath1.picture.assign(icon);
self.p_w_picpath1.update;
end;
finally
icon.free;
end;
p_w_picpath1.Picture.SaveToFile('c:\dddddd.bmp');
end;