Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

check if BalloonTooltip was closed by user

how can I check if BalloonTip attached to NotifyIcon was closed by user clicking "Close" icon or had dissapeared after give timeout? It seems that BalloonTipClosed is fired in both cases, and BaloonTipClicked is fired when user clicks anywhere on appearing tooltip...

like image 372
ts. Avatar asked May 16 '11 12:05

ts.


1 Answers

I don't think it is possible to determine the close button being clicked over the balloon being clicked.

MSDN! lists the messages sent by the Notify Icon. It would appear from that list that there is no distinction between a user clicking the balloon and the user clicking the close button.

As commented below this blog explains why the clicking of the close button does not raise a separate event.

However, this blog has a comment suggesting that, on Windows XP, NIN_BALLOONTIMEOUT is sent when the user clicks the close button. It would be against best practice to rely on quirks like this to make your program run.

Could you implement your own timer that will close the baloon tip upon completion? Make sure you set the balloon tip to display for longer than the timer. Then you can detect whether the timer is still running when the balloon is closed, if not then the timeout closed the balloon, otherwise the user did.

like image 172
IndigoDelta Avatar answered Nov 14 '22 02:11

IndigoDelta