В модуле
ShellApi есть подходящая функция
ExtractAssociatedIcon, вот так ей можно пользоваться
Код:
...
var
Icon : TIcon;
Pch: array[0..256] of Char;
IconIndex: Word;
begin
Icon := TIcon.Create;
StrPCopy(Pch,'C:\WINDOWS\NOTEPAD.EXE');
Icon.Handle:= ExtractAssociatedIcon(hInstance, Pch, IconIndex);
SpeedButton1.Glyph.Width:= Icon.Width;
SpeedButton1.Glyph.Height:= Icon.Height;
SpeedButton1.Glyph.Canvas.Draw(0, 0, Icon);
Icon.Free;
end;
...