目标:在现有Python客户端中实现文件夹和文件图标覆盖[Icon Overlay]
适用范围: win32 系统 , python2.6
构思:
第一阶段:学习Window Icon Overlay实现概念
直观了解
[转载] How to overlay an icon over existing shell objects in 3 easy steps
阐述原理
[转载] Creating Icon Overlay Handlers
Icon overlays are small images placed at the lower-left corner of the icon that represents a Shell object. They are normally added to an object's icon to provide some extra information. For instance, a commonly used icon overlay is the small arrow that indicates that the icon represents a link, rather than the actual file or folder. In addition to the standard icon overlays that are provided by the system, you can request custom icon overlays for specified Shell objects by implementing and registering an icon overlay handler.
Note The number of different icon overlay handlers that the system can support is limited by the amount of space available for icon overlays in the system image list. There are currently fifteen slots allotted for icon overlays, some of which are reserved by the system. For this reason, icon overlay handlers should be implemented only if there are no satisfactory alternatives.
[转载] How to Implement Icon Overlay Handlers
Icon overlay handlers are in-process Component Object Model (COM) objects, implemented as DLLs.
They export one interface in addition to IUnknown: IShellIconOverlayIdentifier.
This interface has three methods:
IShellIconOverlayIdentifier::GetOverlayInfo
IShellIconOverlayIdentifier::GetPriority
IShellIconOverlayIdentifier::IsMemberOf
成功案例
[转载]The documentation for the TortoiseOverlays project explains how they use it and the problems they have encountered (username: guest, empty password), and the GPL'ed sourcecode is in the Subversion repository (same username/password as above)
第二阶段:动手练习
[入门练习] 去 Microsoft CodePlex Open Source Community 下载 All-In-One Code Framework Sample Browser 客户端
下载源代码结构说明,根据Readme.txt可以学习到一些。
编外话:第一次做VS用了半天时间VS2008-VS2010的工作,成功编译dll,但build后不能运行的错误还没有解决。
这个解决方式使用笨方式下载VS2008后打开源代码工程没有问题。编译执行DLL也没问题。但要注意:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers\目录下
注册键值不要超过15个,采用..SampleATLShellExtIconOverlayHandler命名尽量排在前面,超过15个后面的将不起作用。
[TortoiseSVN] 学习开源TortoiseSVN对IconOverlay使用
源代码下载地址 :https://tortoisesvn.googlecode.com/svn/trunk
如果你对Microsoft Visual Studio 2010不熟悉可以Baidu一下
[Microsoft Visual Studio C++ 2010 入门经典]
[Beginning Visual C++ 2008] Ivor Horton著
学习一下