How to: Fire Events When the Editor Loses Focus
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

How to: Fire Events When the Editor Loses Focus

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Sometimes it is necessary to know when an editor loses focus on the window frame. For example, you might need to extract code from a code window after the editor is no longer focused on it. The following procedure provides the steps to follow to receive notification of the editor losing focus.

To fire an event in response to an editor losing focus

  1. Monitor selection events by obtaining an IVsMonitorSelection object from SVsShellMonitorSelection.

  2. Call AdviseSelectionEvents and provide it your IVsSelectionEvents object.

  3. In your call to OnElementValueChanged, look for elementid==SEID_WindowFrame.

  4. Test the varValueNew parameter for two things:

    1. The window frame you are looking for.

    2. The point at which your program loses the selection to that window frame.

See Also

© 2015 Microsoft