Stopping the “Click here balloon”

Visual Studio 2002 and 2003 had the ability to stop a macro from running by double-clicking the small “spinning cassette” in the system tray next to the clock. For example, suppose you had a macro like this:


    Sub NeverEndingMacro()

        Dim ver As String

        While (True)

            ver = DTE.Version

        End While

    End Sub

When you run this macro, it will run forever unless you either kill the vsaenv.exe process or if you double click the spinning cassette in the system tray. Great for when you write a macro like this one that seems harmless, goes horribly, horribly wrong.


The problem: Nobody knew about it. Everybody would see the animation, but they would not think that they could interact with it. Some people thought it was there only as a security feature to let you know if a macro was running without you knowing it.


The solution: A while back, I added code to show one of those Windows XP balloons on the animation to let you know that a macro is being run. When the macro ends, the balloon and the animation go away. Now you have a discoverable feature to get you out of a bad macro.


The new problem: First three or four times you see the balloon, you are notified and you learn about how to stop any errant macros. After 20, 30, 40 times, that balloon become this vile, hated, useless, piece of UI that everybody never wants to see again (I can easily run macros a couple hundred times a day – now you know why it can get on my nerves). But it can also cause UI movement that can be very distracting. Try setting the cassette icon to always be hidden. If you have multiple icons next to the clock, then you get that slide-in, slide-out portion of the task bar. When a hidden icon starts to display a balloon, that part of the tray will slide out causing the tray to twitch uncontrollably if you run the macro over and over.


The new solution: We thought about this for a while, and we could not decide on a way to fix it. Should it be yet another option in tools options among the 1000s of others? We could not hide the balloon after running a macro a specified number of times because if you were to run the macro above with the True changed to False, then the balloon would flash so quickly, you would not see what it read, and after running that macro a few times you would be over the threshold of how many times to show it.


Nobody could settle on one way of doing it, so this was one of those “I am just making the change, everybody deal with it” fixes (in fact, I don’t think anybody on the extensibility team even knows I made the change). If you click on the balloon, not the X on the top right of the balloon but on the text part of the balloon, 5 times it will stop showing. This is controlled with the registry value located at HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\ DontShowMacrosBalloon. You can even set this value to 6 and you will never see the balloon again.