Are there any document window focus events?

大兔子大兔子 提交于 2019-12-24 00:38:21

问题


This one has been a bit of a pain due to a similarly named feature in Visual Studio (which I won't mention here for the sake of people searching).

What I'd like to do is to listen to events regarding which document window has focus

I wish my extension to behave differently depending which SolutionItem is open and has focus. I'd assume there is an event somewhere which will inform me when this focus changes.

I've found where I can listen to when a document opens and closes, but not when a document window has focus.


回答1:


It depends on if you're interested in window events or hierarchy/project selection events.

For Window events (i.e. document/tool window changes in focus), use IVsWindowFrameNotify3.

For Hierarchy/Project item selection change events, check out IVsMonitorSelection.



来源:https://stackoverflow.com/questions/7575607/are-there-any-document-window-focus-events

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!