How do I subscribe to a 3rdparty extension's command from my own VSIX extension? Such as OnClick event of an extension.
If it is a command, you should be able to capture it using
DTE.Events.CommandEvents[commandGuid, commandId].BeforeExecute (or
If you do not know the ID and GUID you can subscribe to all commands (as both indexer parameters are optional), add logging of ID/GUID, then use the command you are interested in.
I believe you have to keep a reference to
DTE.Events.CommandEvents[commandGuid, commandId] somewhere so it will not be garbage collected. Otherwise you may lose your subscription.