Archived

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

Zeke

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 this post


Link to post
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

I hope this help you!

Rafael G. Donato

Share this post


Link to post
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 this post


Link to post
Share on other sites