1

Hello windows experts,

I am searching for a simple way to activate an overlay on files using the context menu. Tortoise SVN gives an example of what can be done. But is very complex compared to my simple need.

For now I am looking at approaching it this way using C++:

http://www.codeproject.com/Articles/545781/NET-Shell-Extensions-Shell-Icon-Overlay-Handlers

http://www.codeproject.com/Articles/10104/Add-a-context-menu-to-the-Windows-Explorer

The issue is to create the link between both of them. The following link suggests to make a map but I am quite puzzle about how:

What the best Language to use when creating Windows Shell Context Menu?

2
  • The context menu and overlay do not communicate with each other. Instead, they communicate with a common back end that maintains the extension state for all files. Jun 25, 2014 at 16:19
  • thank you for the clarification, that's precisely this back end that I am trying to create
    – Pierrot
    Jun 25, 2014 at 20:43

1 Answer 1

1

You can use the Registry, for example store an Enabled value in the HKEY_CURRENT_USER\YourCompany\YourApp key. When the user executes your menu item to turn on/off the functionality, write the appropriate value into Enabled and then call SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, nil, nil). That will cause the shell to re-read icons, including icons from your overlay extension. Inside the IsMemberOf method of your IconOverlay handler, check your Enabled value and return S_FALSE if the functionality has been turned off.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.