• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# Standard Windows icons?

## Recommended Posts

I need to display icons in my ListCtrl but where can i find/get at the icons that windows use as defaults? I particularly want the mp3 icon or any sound icon. I can load in and display icons but only ones ive created myself. Can anyone help me with this? Thanks very much

##### Share on other sites
First, Which Windows Plattaform yor program is going to work?

Locations of Lots of Icons:
In Win 2000/NT -> \System32\Moricons.dll
In Win 95/98/ME -> \Moricons.dll

Rafael G. Donato

##### Share on other sites
You can use SHGetFileInfo to get the icon of a particular file:

  SHFILEINFO fi; HIMAGELIST hImages = (HIMAGELIST)SHGetFileInfo("C:\\", 0, &fi, sizeof(fi), SHGFI_ICON | SHGFI_SMALLICON | SHGFI_SYSICONINDEX);

Failing that, if you look in the Registry for the file type of the extension that you are looking at (eg. mp3). On my system it is registered as "Winamp.file" - in HKEY_CLASSES_ROOT\.mp3

Look under the HKEY_CLASSES_ROOT\Winamp.file key and you will see a DefaultIcon key. The default value in there is an executable path and index for the icon. You can then use ExtractIcon to get the particular icon.

Then draw it with DrawIcon

Hope this helps.

##### Share on other sites
Thanks very much guys. Got it working and i appreciate the help

• ### Forum Statistics

• Total Topics
627737
• Total Posts
2978880

• 10
• 10
• 21
• 14
• 13