Frage

My project runs an event based on a timer. Every time the event is ran it shows a balloon tip for 1 second. If the monitor goes to screen saver and the program continues to run in the background, the event occurs correctly however when the monitor is brought back from the screen saver it will show every balloon tip that was thrown since the screen saver went active. Is there a way to prevent this? I thought perhaps disposing the balloon after 1 second or something but not sure.

War es hilfreich?

Lösung

The default balloontip provided by windows is totally lame. One of the ways in which it is lame is that the ShowBalloonTip() method will silently clamp the supplied delay to be within a certain minimum and maximum which varies from system to system. Rumors have it that the typical values are between 10 and 30 seconds. When I say silently I mean that no error is issued, but the behavior is just not what you would expect. Don't you love it when they do that? The way to work around it is to set up a timer to also fire after the desired time interval, and when the timer fires, cycle the visibility of the tray icon (meaning: make it invisible, and then immediately visible again.)

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top