| |
| Displaying a file's associated icon. |
 |
How do I display the icon that is associated with a given file type?
Use the ShellApi function ExtractAssociatedIcon() to retrieve the icon that is associated with the file.
Example:
uses ShellApi;
procedure TForm .Button Click(Sender: TObject);
var
Icon : hIcon;
IconIndex : word;
begin
Icon := ExtractAssociatedIcon(HInstance,
'C:\SomePath\SomeFile.ext',
IconIndex);
DrawIcon(Form .Canvas.Handle, 0, 0, Icon);
end;
|
|
| Hits/month |
2,500,000+ |
Downloads (Since May 2000) |
7,393,709 |
| Total Files |
6,023 |
| Forum msgs |
7,670 |
| Articles/FAQs |
70+/900+ |
Top Selling Software at Amazon
|