Using Icons


Im trying to add icons to my listview depending on the the file contained within it...

For example say i wanted to find the Icon for the following file


Would would be the best way to do this (using the registry is the only way i guess?) and how would I then add this icon to my listview?

I have some code for finding icons from the registry, its a little cumbersome though, and im hoping someone has a better solution, the more important thing is how can I add the icon to the listview (or an imagelist if needs be) - this should be the easy part but I just dont know how to handle the icons.

Who is Participating?
David LeeConnect With a Mentor Commented:
And another by someone different.
David LeeCommented:
Here's a link to an article that describes how to retrieve the icon associated with a given file type.
KarlPurkhardtAuthor Commented:
Thats exactly what I was looking for, thanks.
David LeeCommented:
You're welcome.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.