Jump to content
  • Advertisement

Archived

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

Zeke

Standard Windows icons?

This topic is 6114 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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

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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!