.NET:如何创建文件图标叠加 [英] .NET: How Do I Create File Icon Overlays

查看:121
本文介绍了.NET:如何创建文件图标叠加的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想了各种文件的图标添加不同的图标叠加(注:特定类型的不是所有的文件,只是某些文件)。如果你不明白我的意思,我指的是,例如TortoiseSVN,TortoiseHG,Dropbox的,等什么程序做的。

I'm trying to add different icon overlays over the icons of various files (note: not all the files of a certain type, just certain files). If you don't get what I mean, I'm referring to what programs like TortoiseSVN, TortoiseHG, Dropbox, etc. do.

这可以在.NET做什么?如果是这样,怎么样?我希望有一个图书馆在那里这一点。我发现这$ C $的CProject文章关于这样的事情,但它不是.NET。

Can this be done in .NET? If so, how? I'm hoping there's a library out there for this. I found this CodeProject article about something like this, but it's not .NET.

在此先感谢。

推荐答案

没有,这不是.NET。 shell编程是在非托管的C / C ++的领域。 Shell32.dll中有一个类型库,使其可用于脚本语言和.NET的一些功能。但IShellIconOverlay接口继承自IUnknown,无法接触到的脚本。这在技术上是可行的,但你必须要重新声明在C#中的接口,使用SDK的SHLOBJ.H头文件作为模板在声明。有人做了它的地方,可能是,但它是罕见的尝试,使其工作。快速谷歌搜索变成了没什么用处。

No, it's not .NET. Shell programming is in the domain of unmanaged C/C++. Shell32.dll has a type library that makes some functions available to scripting languages and .NET. But the IShellIconOverlay interface inherits from IUnknown, not accessible to scripting. It is technically possible but you'll have to redeclare the interface in C#, using the declaration in the SDK's ShlObj.h header file as a template. Somebody has done it somewhere, probably, but it is uncommon to try to make it work. A quick Google search turns up nothing useful.

希望,.NET 4.0将恢复一些活动,解决了CLR版本注入的问题。我还没有看到它的一个标志。

Hopefully, .NET 4.0 will revive some activity, solving the CLR version injection problem. I haven't yet seen a sign of it.

这篇关于.NET:如何创建文件图标叠加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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