Sorry to have confirmed my fears, but this cannot be done in Java.
Since Windows Explorer is the manager, Icon Overlay is a kind of plugin. It should be implemented as a DLL (not JNI, but a real native DLL) and registered in the Windows registry. As you saw in the CodeProject article, your DLL must implement a specific interface - IShellIconOverlayIdentifier .
Take, for example, the implementation of TortoiseSVN .
TortoiseSVN DLL is loaded by explorer and attached to its process:
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID ) { ... if (dwReason == DLL_PROCESS_ATTACH) ...
To do this in Java, you will need to write a DLL that will load the JVM and your JAR, which would be redundant.
Regarding the overlay on the Tray icon, your Java application is the host, so you can do it.
Cebence
source share