Balloon Tips, NotifyIcon and Windows 2000

While i’m sure this isn’t relevant to most of my readers, again this has bugged me on and off for the last hour so thought I would blog for future reference for anyone else.

I’ve got a nice working SysTray application which displays a balloon tip message, that when a user clicks the tip it launches another separate dialog.  This worked great on Vista and XP however I decided just to do a little test on Windows 2000 (yes, its still used!).  I found that when you click the balloon tip on 2000, nothing happens.  Turns out this is because the shell_NotifyIcon is a different version on 2000 than XP/Vista and the event isn’t being handled correctly.

The only way I found to fix this is no to only have the balloon tip click (BalloonTipClicked) event wired up but also the Click event on the actual NotifyIcon class wired up as well.  This way, when the user clicks the icon is will display.  Sadly, if they click the Balloon tip nothing will happen but at least there is still some support for 2000 in place.

I then found that on Vista/XP where it worked correctly before, now when the systray icon is clicked both the BalloonTipClicked and the NotifyIcon.Click event are fired, hence opening the form twice!  Quick solution was to use a boolean member variable which knows if the form is currently visible or not.  Nothing fancy…

Technorati Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *