开发者

get file icon for Outlook appointment (.msg)

I've read Get File Icon used by Shell and the other similar p开发者_StackOverflow中文版osts - 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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜