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.


Comments (14)

  1. Morton says:

    Instead of balloon tip there could have been like:

    After starting VS cold, on first macro run, show balloon and tell about key to stop macro or whatever.

    On later macro runs, show animated notify tray icon when macro running, if you hover over this, it shows the tip about how to stop macros. If you click the icon, it shows checkbox to disable the animating icon either until next boot of computer or forever.

    Ok so that’s pretty complex. But no big deal with C#. If you can give C# code to popup a simple system balloon, I’d love that. It requires too much interop, couldn’t figure it all out when I tried ..

  2. Morton says:

    Ah, thanks to the new VS beta1 help, I found an article about the balloon, using interop. Great!

  3. "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"

    I guess we run on the same problem again: Nobody knew about it, unless they are told about it.

    What about putting a "Don’t show this again" checkbox inside the balloon, so giving the user a frindlier way of choosing what he/she wants?

  4. Craig Skibo says:

    These were all things we considered, a checkbox inside a balloon is not, to the best of my knowledge) supported on all the platforms we support (W2K and XP). We thought about making it show only the first time you ran a macro for each instance of VS, but this could be confusing also. Suppose you ran a macro that was very quick to do its work (copy the selected text from the selected document, for example). The casette would appear the balloon woud pop up, then quickly disappear. The user, seeing the flash of the balloon in the corner, would run the macro again to see what it says. But this time (and every time after running the macro in that instance), the balloon does not show. This is actually a common "bug" report that we get: "I do something, got something odd to show up, and now I can’t get it to happen again. What happened and how do I do it again?" The "Hey, look at me factor" is not as great.

  5. Alen Ladavac says:

    How about this: if the macro lasts more than 3 seconds, the message will be visible for as long as the macro is running, but if the macro lasts shorter than 3 seconds, make the message stay for 3 seconds anyway. That way you assure that people can read the message and get a chance to click on it. (This is important, because e.g. I run macros that last under a second, and clicking on the balloon at all, let alone on some specific area in it, is very hard. 🙂

    Now that you have that assured, you can start playing with how to turn it off. I suggest a "Click on balloon for options." as part of the message. Then if the user clicks, you can pop up a separate dialog asking "Do you ever want to see this again?". So you don’t need to bend backwards trying to add checkboxes to balloons. 😉

    What do you think?

  6. I’ve always loved editors with built in macro languages.  Once you have macro control of every facet…

  7. rjh says:

    Just a Suggestion but I would not have the popup at all unless you are in the Macro editor (where you are suposed to test you macros). Things like while on the surface are good ideas, ends up really causing trouble for the experienced coder that has a number of quick and dirty macros. (for Function headers and the like)

    Thank You

  8. rjh says:

    Just a Suggestion but I would not have the popup at all unless you are in the Macro editor (where you are suposed to test you macros). Things like while on the surface are good ideas, ends up really causing trouble for the experienced coder that has a number of quick and dirty macros. (for Function headers and the like)

    Thank You

  9. Ben says:

    Man is this thing ever annoying.  I use the ctrl-shift-r, ctrl-shift-p macro feature all the time, and the balloon doesn’t come up long enough to read it, much less click on it.  Searching for the term ‘macro balloon’ in the microsoft help reveals nothing.  So we have an annoying piece of UI that can’t be turned off, brilliant.  If I have to resort to google to find a page on the web that tells me how to deactivate this thing, to me that indicates that it is broken.  

    Just a suggestion – if you have to click on the balloon 5 times to make it go away, why not say that on the balloon?  That way the user might stand a chance of knowing what to do.  

  10. 猿頁 says:

    VSマクロを実行させると、システムトレイにカセットテープアイコンが表示され、実行中ずっとぐるぐる回る…

  11. Scott says:

    Can I stop the "“spinning cassette” in the system tray next to the clock" from appearing?  For macros that run very quickly the flashing is anoying.

  12. Michael M. says:

    I know this does not solve the underlying design issues, but I came here just to find out how to turn off the "vile, hated, useless, piece of UI that everybody never wants to see again."

    If you run the above infinite loop NeverEndingMacro() macro, the balloon stays open long enough to actually read the message and take action to prevent it from popping up again.

    I have no idea how to get the balloons back…  Can’t imagine why someone would want to do so.  If you do end up running an infinite loop / locked up macro, you still get the "spinning cassette"

    Have not addressed the annoying quick flash of the ‘"spinning cassette" in the system tray next to the clock’.  But, I can live with it, for now anyway.

  13. B says:

    How about only show this balloon if the spinning cassette is open for more than, say, 15 secs?  Because a macro with a running time of less than that is not stuck.  In fact, hiding the spinning cassette itself until a macro has been running more than 5 secs would make sense to me, who needs the start bar twiddling for a macro that takes .2 secs to run, as most of mine do?

    Also, if you click on the balloon (and not the X-box to close it), bring up a control panel where you are allowed to turn it off, change the timeouts, interrupt the current macro, etc.

  14. Daniel says:

    The tape recorder is cute, but it needs to die.