c++windowsiconswindows-shelloverlays

Overlays icon on different files based on statuses


Hi i am new to shell extensions. I read the http://www.codeproject.com/KB/shell/overlayicon.aspx article and was able to show overlays icon on the files whose names contains the string "sample". Now my question is that i have an application, that displays different overlays for different files based on file status, such as uploaded, uploading , not uploaded etc. please help me how can i set overlays for specific files/folders in specific path in the system. Thanks


Solution

  • Just apply what you've learned in that article. What you're wanting to do now is almost the same thing. The shell calls your handler and asks for an overlay icon. Your code checks the item's status, and returns the correct overlay icon. If you don't own the item, you tell the shell not to draw an overlay at all.

    You can read more about Creating Icon Overlay Handlers on MSDN.

    Or, as David suggests here and Richard suggests here, you can browse the TortoiseSVN source code (since it's licensed under the GPL) to see how they did it, if you prefer to learn by example.

    But remember that the shell imposes a hard limit on the number of overlay icons that can be registered. Currently, that number is 15. You will run into problems if your application tries to register too many, or if your users have other applications installed (such as TortoiseSVN) that have also registered overlays. You may want to seriously reconsider whether this is really the appropriate way to display information.