end2endzone / ShellAnything

ShellAnything is a C++ open-source software which allow one to easily customize and add new options to *Windows Explorer* context menu. Define specific actions when a user right-click on a file or a directory.
MIT License
180 stars 27 forks source link

Shared properties #153

Open Vzz1c opened 1 month ago

Vzz1c commented 1 month ago

<property name="compare.first.selection.path" value="${selection.path}" /> The value of the property should be shared between different applications calling the context menu, for example if I use my own explorer and click on it and compare.first.selection.path produces the value, and I use TotalCMD to call the context menu, compare.first.selection.path doesn't have a value, it's in its initial state, of course, it doesn't have any value. doesn't have a value, it's the initial state, and of course, it's not just with TotalCMD, any application that can call a context menu can't share the property

end2endzone commented 1 month ago

Sharing properties across multiple applications is not supported at the moment. I also do not plan to support this. The intended way right now is that each application loads their own instance of ShellAnything. All instances are independent from each other.

This feature would require communication between explorer.exe and TotalCMD.exe for synchronizing properties. ShellAnything is single threaded. This decision greatly simplifies the code and potentials problems. Shared properties across multiple applications also risk potential locks. For example, locking explorer.exe (not responsive) while TotalCMD.exe is processing Actions.

Also, some properties should absolutely not be synchronized across multiple applications. For example :

If you absolutely need this feature, you could implement it yourself with a plugin. Documentation is available in the User Manual. I would suggest that you design your plugin to something similar to the example sa_plugin_services. This plugin uses [a callback function](sa_plugin_services_update_callback()) that is called when the selection changes (ShellAnything is updated and about to be displayed). You could implement your own properties synchronization mechanism between multiple ShellAnything instances at this point.