Are there any document window focus events?

2019-07-15 00:23发布

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

Pic demonstrates the selected document window in Visual Studio

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条回答
2楼-- · 2019-07-15 00:55

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.

查看更多
登录 后发表回答