.NET:如何创建文件图标叠加图标、文件、NET

由网友(择一城终老)分享简介:我想了各种文件的图标添加不同的图标叠加(注:特定类型的不是所有的文件,只是某些文件)。如果你不明白我的意思,我指的是,例如TortoiseSVN,TortoiseHG,Dropbox的,等什么程序做的。I'm trying to add different icon overlays over the icons o...

我想了各种文件的图标添加不同的图标叠加(注:特定类型的不是所有的文件,只是某些文件)。如果你不明白我的意思,我指的是,例如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.

阅读全文

相关推荐

最新文章