Yeah, I posted this just a while ago....
function LoadSmallIcon(const FileName: AnsiString; ID: integer): hicon;
S : array[0..255] of char;
IconHandle : hIcon;
Index : Word;
StrPLCopy(S, FileName, SizeOf(S)-1);
IconHandle := ExtractIcon(hInstance, S, Id);
if IconHandle < 2 then begin
Index := Id;
IconHandle := ExtractAssociatedIcon(hInstance, S, Index);
Result := CopyImage(IconHandle,
"We are Microsoft. Resistance is Futile. You will be Assimiliated."
>I am using ExtractAssociatedIcon and it works fine for 32x32 icons.
>Does anyone know if there is a way to extract 16x16 associated icon?
>Thank you all,
>I am also a VB programmer and have subscription to VB mailing list with
>over 4000 people, and I notice that in Delphi newsgroup we all love or like
>Borland but in Visual Basic list 90% of the people have nothing nice to say
>about Microsoft :))
>Please do not start any huge discussion about this PS, I think that "Future
>of Delphi" is enough.