如何获取没有快捷链接箭头的小图标 [英] How to get the small Icon without an arrow of a shortcut link

查看:116
本文介绍了如何获取没有快捷链接箭头的小图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在VB.Net中获取快捷方式链接的图标,请注意,快捷方式的图标不一定是该链接指向的项目的图标.并且请注意,快捷方式可能指向某些特殊位置,例如C:\或我的电脑

How to get the icon of a shortcut link in VB.Net, please note the icon of a shortcut is not nessecarily the icon of the item the link points to. And please note a shortcut may refer to some special location, like C:\ or My Computer

到目前为止已尝试:

将hImgSmall设置为IntPtr = SHGetFileInfo(filePath,0,shinfo,Marshal.SizeOf(shinfo),SHGFI_ICON)可以完成工作,但是返回带有箭头的图标.

Dim hImgSmall As IntPtr = SHGetFileInfo(filePath, 0, shinfo, Marshal.SizeOf(shinfo), SHGFI_ICON) does a job, but returns an icon with an arrow.

使用IShellLink可以使用某些快捷方式(没有箭头的快捷方式的小图标),但是会为空白的快捷方式(特定的位置,例如磁盘,控制面板,我的电脑等)或具有快捷方式的快捷方式提供一个空的IconLocation.自定义图标.

Using IShellLink works for some shortcuts (small icon of the shortcut without the arrow), but gives an empty IconLocation for of shortcuts to special locations (like disk, control panel, my computer, ect..) or shortcuts that have a custom icon.




IShellLink

IShellLink





推荐答案

您想要的图标或快捷方式,在我看来您正在混合使用.
What you want an Icon or a Shortcut, it seems to me you're mixing something.


这篇关于如何获取没有快捷链接箭头的小图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆