1

I've read Get File Icon used by Shell and the other similar posts - and already use SHFileInfo to get the associated icon for any given extension, and that works great.

However, Outlook uses ".msg" for mail and appointment items (if you drag an email and drag an event onto your desktop, the resulting icons are different). I noticed that if I use the registry method, the standard envelope icon is at index 17 of C:\WINDOWS\Installer{90120000-0011-0000-0000-0000000FF1CE}\outicon.exe (on my XP machine running Outlook 2007) - and, conveniently enough, the appointment icon is at index 18. I can hardcode 18 when extracting the icon, but that sounds very flimsy.

Given the filename of an email or an appointment (but not the actual file), and knowledge that it is an email or an appointment, does anybody know how to get the correct icon, either through the shell or through the registry?

Of course, if I had the actual file handy, I could just use Icon.ExtractAssociatedIcon, but in the system I'm working on, we're showing a list of files that are stored elsewhere and downloading each of them beforehand is not possible.

1 Answer 1

1

If you know when it an appointment or a mail, could you not pass "appointment.ics" into your SHFileInfo funnction and get the the right icon ? Marcus

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.