質問

I have one VSPackage with some commands registered in the Initialize() function and are accessible globally using toolbar/menu/shortcut keys. This VSPackage also has one Tool Window (derived from ToolWindowPane) similar to Solution Explorer with its commands registered in OnCreate(). Tool Window commands are also working fine via toolbar/menu/shortcut keys when Tool Window is active/in focus. But when this is hidden behind another window (e.g. Solution Explorer), tool window commands are not accessible.

Please let me know how to make inactive tool window commands accessible.

役に立ちましたか?

解決

I found the solution: Command handler should be first added to the main Package and then to the ToolWindow otherwise ToolWindow command will work only when it has focus.

Please refer function DefineCommandHandler() in PersistedWindowPane.cs and PackageToolWindow.cs of VSSDK IDE Sample.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top