开发者

.NET: How Do I Create File Icon Overlays

开发者 https://www.devze.com 2022-12-24 07:12 出处:网络
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 progra

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.

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.

Thanks in advance.


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.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消