获取任何文件/文件夹的系统图标 [英] Get System Icon for any file/folder

查看:81
本文介绍了获取任何文件/文件夹的系统图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如何检索与文件/文件夹关联的系统图标,以便

我可以在文件/文件夹旁边的列表视图中显示它姓名?


问候,

Ashutosh Bhawasinka

Hi,
How can I retrieve the system icon associated with a file/folder so that
I can show it in the list view adjacent to the file/folder name?

Regards,
Ashutosh Bhawasinka

推荐答案

你好Ashutosh,


根据你的描述,你想在你的

..net应用程序中获取文件/文件夹图标,对吗?如果我误解了这里的任何内容,请不要咋b
犹豫要纠正我。


如果是这种情况,您可以参考以下文章。这个文件

有关于如何通过SHGetFileInfo(WinAPI)获取和显示文件/文件夹图标的详细示例代码。

我已在该页面中测试过示例代码。我相信它可以在你的应用程序中运行良好,而且没有任何变化。 :)

http:// www。 codeproject.com/KB/files/fileicon.aspx

[在C#中使用SHGetFileInfo获取(和管理)文件和文件夹图标]


希望这可以帮助。请尝试上述方法,如果您有任何疑虑,请告知我们。我们很乐意为您提供帮助。

祝您度过愉快的一天,

祝您好运,

文元


Microsoft在线社区支持

让我们的客户满意是我们的首要任务。我们欢迎您的意见和

有关我们如何改进我们为您提供的支持的建议。请

随时让我的经理知道您对服务水平的看法

提供。您可以直接向我的经理发送反馈:
ms****@microsoft.com

============================================== ====

通过电子邮件收到我的帖子通知?请参阅
http://msdn.microsoft .com / subscripti ... ult.aspx#notif

ications。

注意:MSDN托管新闻组支持服务适用于非紧急问题

,可以在1个工作日内收到社区或Microsoft支持工程师的初步回复。请注意,每个跟随

的响应可能需要大约2个工作日作为支持

专业人士与您合作可能需要进一步调查才能达到

最有效的分辨率。该产品不适用于需要紧急,实时或基于电话的交互或复杂的b $ b项目分析和转储分析问题的情况。这种性质的问题最好通过联系

Microsoft客户支持服务(CSS)处理
href =http://msdn.microsoft.com/subscriptions/support/default.aspx\"target =_ blank> http://msdn.microsoft.com/subscripti...t/default.aspx

======================================== ==========

此帖子按原样提供。没有保证,也没有授予任何权利。

Hello Ashutosh,

According to your description, you want to get the file/folder icon in your
..net application, correct? If I misunderstood anything here, please don''t
hesitate to correct me.

If this is the case, you may refer to the following article. This document
has detailed sample code about how to get and display file/folder icon in
managed application by SHGetFileInfo (WinAPI).
I have tested sample code in that page. I believe it could works fine in
your application without any change, too. :)

http://www.codeproject.com/KB/files/fileicon.aspx
[Obtaining (and managing) file and folder icons using SHGetFileInfo in C#]

Hope this helps. Please try the above method and let me know if you have
any more concern. We are glad to assist you.
Have a great day,
Best regards,
Wen Yuan

Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


谢谢!!

这正是我所需要的。


问候,

Ashutosh


Wen Yuan Wang [MSFT]写道:
Thanks!!
This is exactly what I needed.

Regards,
Ashutosh

Wen Yuan Wang [MSFT] wrote:

你好Ashutosh,


根据你的描述,你想在你的

.net应用程序中获取文件/文件夹图标,对吗?如果我误解了这里的任何内容,请不要咋b
犹豫要纠正我。


如果是这种情况,您可以参考以下文章。这个文件

有关于如何通过SHGetFileInfo(WinAPI)获取和显示文件/文件夹图标的详细示例代码。

我已在该页面中测试过示例代码。我相信它可以在你的应用程序中运行良好,而且没有任何变化。 :)

http:// www。 codeproject.com/KB/files/fileicon.aspx

[在C#中使用SHGetFileInfo获取(和管理)文件和文件夹图标]


希望这可以帮助。请尝试上述方法,如果您有任何疑虑,请告知我们。我们很乐意为您提供帮助。

祝您度过愉快的一天,

祝您好运,

文元


Microsoft在线社区支持

让我们的客户满意是我们的首要任务。我们欢迎您的意见和

有关我们如何改进我们为您提供的支持的建议。请

随时让我的经理知道您对服务水平的看法

提供。您可以直接向我的经理发送反馈:
ms****@microsoft.com

============================================== ====

通过电子邮件收到我的帖子通知?请参阅
http://msdn.microsoft .com / subscripti ... ult.aspx#notif

ications。

注意:MSDN托管新闻组支持服务适用于非紧急问题

,可以在1个工作日内收到社区或Microsoft支持工程师的初步回复。请注意,每个跟随

的响应可能需要大约2个工作日作为支持

专业人士与您合作可能需要进一步调查才能达到

最有效的分辨率。该产品不适用于需要紧急,实时或基于电话的交互或复杂的b $ b项目分析和转储分析问题的情况。这种性质的问题最好通过联系

Microsoft客户支持服务(CSS)处理
href =http://msdn.microsoft.com/subscriptions/support/default.aspx\"target =_ blank> http://msdn.microsoft.com/subscripti...t/default.aspx

======================================== ==========

此帖子按原样提供。没有保证,也没有授予任何权利。
Hello Ashutosh,

According to your description, you want to get the file/folder icon in your
.net application, correct? If I misunderstood anything here, please don''t
hesitate to correct me.

If this is the case, you may refer to the following article. This document
has detailed sample code about how to get and display file/folder icon in
managed application by SHGetFileInfo (WinAPI).
I have tested sample code in that page. I believe it could works fine in
your application without any change, too. :)

http://www.codeproject.com/KB/files/fileicon.aspx
[Obtaining (and managing) file and folder icons using SHGetFileInfo in C#]

Hope this helps. Please try the above method and let me know if you have
any more concern. We are glad to assist you.
Have a great day,
Best regards,
Wen Yuan

Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


你好Ashutosh,


欢迎你。如果您需要任何进一步的帮助,请随时再次告知我们。 :)

我们很乐意为您提供帮助。


祝您度过愉快的一天,

祝您好运,

Wen Yuan


Microsoft在线社区支持

让客户满意是我们的首要任务。我们欢迎您的意见和

有关我们如何改进我们为您提供的支持的建议。请

随时让我的经理知道您对服务水平的看法

提供。您可以直接向我的经理发送反馈:
ms****@microsoft.com

============================================== ====

此帖子按原样提供。没有保证,也没有授予任何权利。
Hello Ashutosh,

You are welcome. If you need any further assistance, just feel free to let
us know again. :)
We are glad to assist you.

Have a great day,
Best regards,
Wen Yuan

Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


这篇关于获取任何文件/文件夹的系统图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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