获取 Outlook 约会的文件图标 (.msg)
我读过 获取 Shell 使用的文件图标 和其他类似的帖子 -并且已经使用 SHFileInfo 来获取任何给定扩展名的关联图标,效果很好。
但是,Outlook 对邮件和约会项目使用“.msg”(如果将电子邮件和事件拖到桌面上,则生成的图标会有所不同)。我注意到,如果我使用注册表方法,标准信封图标位于 C:\WINDOWS\Installer{90120000-0011-0000-0000-0000000FF1CE}\outicon.exe 的索引 17(在运行 Outlook 2007 的 XP 计算机上) -而且,很方便的是,约会图标位于索引 18。我可以在提取图标时对 18 进行硬编码,但这听起来很脆弱。
给定电子邮件或约会的文件名(但不是实际文件),并且知道它是电子邮件或约会,是否有人知道如何通过 shell 或通过注册表获取正确的图标?
当然,如果我手边有实际的文件,我可以只使用 Icon.ExtractAssociatedIcon,但在我正在使用的系统中,我们显示存储在其他地方的文件列表,并且不可能预先下载每个文件。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您知道它是约会或邮件,您是否无法将“appointment.ics”传递到 SHFileInfo 函数并获得正确的图标?
马库斯
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