How do you intercept taskbar notification balloons?


A customer wanted to know how they could monitor and intercept taskbar notification balloons. In particular, they wanted to intercept the clicks on a particular balloon and take alternative action.

There is no supported mechanism for intercepting taskbar notification balloons or redirecting clicks on them.

Imagine if that were possible: Fabrikam would intercept notification balloons for Contoso. If they had access to the balloon text itself, they might change the message from "Contoso products are back in stock. Click here to place your order." to "Special offer for Contoso customers: Take 10% off your first order from Fabrikam."

If they could intercept clicks, then Fabrikam might take clicks on the balloon that normally send the user to the Contoso ordering dialog and instead sends them to a Web page where they can download Fabrikam Supply Chain Management Software.

And then Contoso would ask for a way to block the interception because Fabrikam is preventing their software from working. And then Fabrikam would say "Infinity", and then Contoso would say "Infinity plus one."

While those two programs are busy fighting over who gets the clicks, LitWare sneaks in and says, "I want to steal the clicks that those two companies are fighting over, so I can display my custom user interface instead."

The only way to win is not to play the game. There is no facility for intercepting balloon notifications or redirecting their clicks. The application which creates the balloon decides what the balloon says and what happens if the user clicks on it. If you want to alter the text or behavior of a balloon notification, you get to work with the developers of the application that is displaying the balloon and see if they are willing to give you a way to intercept their messages and clicks.

Comments (15)
  1. Joshua says:

    I already imagined this and can see why it should exist.

    1. Accessibility

    2. Alternate shell

    I don't see how these can be both possible w/o what was asked for here being possible. Last one to move wins though.

    [Accessibility does not need to intercept clicks or modify static text. It reads the screen and generates clicks. -Raymond]
  2. Evan says:

    @Joshua: "2. Alternate shell"

    I'd love an alternate shell as much as the next person, but in this case I think Raymond gives a reasonably convincing case that providing an intercept mechanism (at least while explorer is active, e.g. if you wanted to do a thin wrapper around explorer) would compromise the experience of using the normal shell. And if you look at things at what makes the most people happy, supporting alternate shells doesn't come out looking so good.

  3. Brian_EE says:

    Joshua: "Greetings, Professor Falken."

    Stephen Falken: "Hello, Joshua."

    Joshua: "A strange game. The only winning move is not to play. How about a nice game of chess?"

  4. Joshua says:

    I haven't been able to find documentation; however I suspect the wrapper is not very thin. I have reason to believe it's the entire desktop and taskbar.

  5. Brian says:

    Doesn't your scenario involve being on the other side of this airtight hatchway?

    Not to mention it'd be solved rather quickly by litigation.

  6. alegr1 says:

    The unanswered (or unasked) question is, of course, "why do you want that?".

  7. Cesar says:

    @Brian: litigation means nothing if the target of the litigation is from a foreign jurisdiction. Microsoft Windows is used in more than just the USA.

  8. Joshua says:

    [Accessibility does not need to … modify static text. It reads the screen … -Raymond]

    The ability to read the screen is the ability to know it's there. The ability to know it's there (for desktop applications) is the ability to overlay it. Some legit accessibility fixes do this.

    [True, you could put something over it to steal the clicks. But that's different from the notification system designing in a feature to let people steal clicks. At that point, you know you're doing something bad. -Raymond]
  9. Matt says:

    But the answer is that you CAN do this. You inject into the process and Detour "Shell_NotifyIcon" so that you get the click when the balloon is shown and then call the "real" handler once you're done.

    Then, if Litware wants to prevent Contoso from messing with the balloons – they just ACL their process so Contoso can't inject into their process. If the user then goes ahead and gives Contoso super-user privileges, well, it's the user's computer, they can do what they like.

  10. Erbo says:

    Perhaps you should just tell the customer, "How would you like it if someone were able to intercept YOUR intercepts, and change the actions that you wanted taken when that balloon is clicked on? Because that's what would be enabled by the capability you're asking for."

    Something like a "Golden Rule" for UI interactions: "What you would not like if it were done to you, do not do to others."

  11. Joshua says:

    @Erbo: … Golden Rule …: From reading most of these, they seem to come from either high-up or (occasionally) particularly clueless managers with too big an ego to be able to apply the Golden Rule, and given to some probably mediocre engineer who can't do it directly so uses the support contract they have with MS to ask the question.

  12. Escaper says:

    Why are we talking about intercepting notification balloons and not about other ways to interfere with someone else's application? There are many such ways in Windows I believe and intercepting balloons is quite exotic one among them. If we want to prevent such intervention, we should start with preventing processes from getting handlers to each other's windows. That is possible however, as far as I know.

  13. Marc K says:

    Golden rule?  That's not the world we live in.  

    http://www.dowling.edu/…/bb-TooManyToolbars.jpg

  14. cheong00 says:

    On the other hand, if I were writing "Blade cluster" like server solutions, is there supported way for me to redirect ALL notification balloons to our *super awesome* monitor console?

  15. Joshua says:

    That's what's accessibility scrapers are for.

Comments are closed.

Skip to main content