Standard Windows icons?
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
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
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
You can use SHGetFileInfo to get the icon of a particular file:
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement