Standard Windows icons?

Started by
2 comments, last by Zeke 22 years, 5 months ago
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
Just my thoughts take them as you will. "People spend too much time thinking about the past, whatever else it is, its gone"-Mel Gibson, Man Without A Face
Advertisement
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
"Be forgotten is worse than death..."[email=rgdonato@gmail.com]Rafael G. Donato[/email]
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.
"Absorb what is useful, reject what is useless, and add what is specifically your own." - Lee Jun Fan
Thanks very much guys. Got it working and i appreciate the help
Just my thoughts take them as you will. "People spend too much time thinking about the past, whatever else it is, its gone"-Mel Gibson, Man Without A Face

This topic is closed to new replies.

Advertisement