On 25.11.2009 22:58, Stanimir Stamenkov wrote: > Wed, 25 Nov 2009 23:50:09 +0200, /Stanimir Stamenkov/: >> Sat, 21 Nov 2009 11:39:00 +0100, /Adrian Buehlmann/: >> >>> Regarding the overlays, Windows 7 has the inherent problem that >>> it provides too few slots for overlay handlers out of the box >>> as noted in: http://bitbucket.org/tortoisehg/stable/issue/324 . >> I don't have technical knowledge how the overlay icons work, but >> I've wondered whether these could be implemented by dynamically >> serving different images from a single handler? This sounds too >> simple to be that easy, but anyway. > > I guess I've found the answer myself > <http://msdn.microsoft.com/en-us/library/cc144123(VS.85).aspx#unknown_4327>: > >> *Implementing GetOverlayInfo* >> >> This method is first called during initialization. The method >> returns the fully qualified path of the file containing the icon >> overlay image, and its zero-based index within the file. The Shell >> then adds the image to the system image list. Icon overlays can be >> contained in any of the standard file types, including .exe, .dll, >> and .ico. >> >> After initialization is complete, the Shell calls GetOverlayInfo >> when it needs to display the handler's icon overlay. The method >> should return the same file name and index that it did during >> initialization. Although the Shell uses the image that is cached in >> the system image list rather than loading the image from the file, >> an icon overlay is still identified by its file name and index. > > Given "the method should return the same file name and index that it > did during initialization" I understand it is not possible to use a > single handler for different images, but then "although the Shell > uses the image that is cached in the system image list rather than > loading the image from the file, an icon overlay is still identified > by its file name and index" leads me to think there might be a > slight chance of it being possible. >
Thank you for digging into this. It's very good having more people thinking about this, so I appreciate your effort. TortoiseHg uses the TortoiseOverlays package, which is provided by the TortoiseSVN project with the goal to share the same slots and icons among all Tortoise projects (slot handler sharing). TortoiseOverlays works as a so called "shim". It's a dll which establishes an intermediate layer between the TortoiseHg shell extension and the Windows API. The TortoiseHg shell extension consumes the same COM interface as the Windows API provides, but that interface is not implemented by the Windows API, it is implemented by the TortoiseOverlays.dll, which in turn calls the Windows API. Take a look in the TortoiseOverlays directory in the directory where you have installed TortoiseHg (I have it in C:\Program Files\TortoiseHg\TortoiseOverlays). There you'll find the file 'Documentation.txt' which explains in technical detail how this shim works. In that directory, you'll also find two *.msi installer packages. One is for the x86 explorer (32 bit) and the other for the x64 explorer (64 bit) (and for 32 bit and 64 bit applications that fire up an open file dialog likewise). Our installer installs both of them on 64 bit platforms. The TortoiseOverlays.dll on my Windows XP is installed in the directory C:\Program Files\Common Files\TortoiseOverlays The sources for the TortoiseOverlays package seem to be accessible at http://tortoisesvn.tigris.org/svn/tortoisesvn/ (use 'guest' as username, password empty). After you have logged-in, navigate into the 'TortoiseOverlays' subdirectory. I don't know which mailing list or other resources are available about developing the TortoiseOverlays package. But slot contentions have to be attacked in TortoiseOverlays. In fact, we should probably find out what the TortoiseOverlays subproject is doing with the Windows 7 problem. I was just too lazy in the past to try digging deeper there. And today, I don't even have access to a final Windows 7 (which reduces my motivation to dig deeper even more). All I have is a Windows 7 RC (which will expire in the first half of 2010, IIRC). ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Tortoisehg-discuss mailing list Tortoisehg-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tortoisehg-discuss