If I add a WindowEvents_WindowActivated
handler to my Visual Studio 2005 Macros EnvironmentEvents
module, I get a weird side-effect: when I click from one window to another in Visual Studio, that click is treated as a double click.
So for instance, I put the focus in an editor window and click a file in Solution Explorer, and the file opens.
Or I put the focus in the Toolbox and click in an editor window, and the word I click on gets selected. In most cases, when a single-click causes a window to activate, that click is being treated as a double-click.
This happens even with an empty event handler:
Private Sub WindowEvents_WindowActivated(ByVal GotFocus As EnvDTE.Window, _
ByVal LostFocus As EnvDTE.Window) _
Handles WindowEvents.WindowActivated
' Do nothing.
End Sub
I want to use the WindowActivated
event to do cool stuff, but this is a killer. Has anyone seen this before and worked around it? (I know I could use a timer and poll for the current window, but yuck.)