vsCommandStatus illogical rules put to work
Note: this entry has moved.
I spend quite a bit of time trying to make the most "natural" scenario work:- you have an addin that creates some commands
- you want those commands to be invisible when the addin is not loaded
- you want your code (through QueryStatus) to determine if the command is shown or not when the addin is loaded
- vsCommandStatusInvisible: QueryStatus never gets called even if the addin is loaded (?!?!)
- vsCommandStatusInvisible + vsCommandStatusSupported: commands are always visible and enabled even if the addin is not loaded (?!)
- vsCommandStatusInvisible + vsCommandStatusEnabled: when the addin is loaded, commands are always grayed-out and QueryStatus is never called (?!). When the addin is not loaded, commands do not appear (OK).
- vsCommandStatusInvisible + vsCommandStatusUnsupported: commands are always visible, but grayed-out, even if the addin is not loaded and the QueryStatus is never called (?!)
- vsCommandStatusInvisible + vsCommandStatusEnabled + vsCommandStatusSupported: when the addin is loaded, commands are always visible/enabled and QueryStatus is never called (?!). When the addin is not loaded, commands do not appear (OK).
- vsCommandStatusInvisible + vsCommandStatusEnabled + vsCommandStatusLatched: commands are always visible but grayed-out and QueryStatus is never called (?!).
So far, I couldn't find a @#$%@#$%^ way to do the simplest thing in the world.... I'm runing out of ideas/status combinations... any ideas?!