Is there a way to clear system tray during VB.NET app crash?

T

Tom

Hello,

System tray icon informs users that the apps is running in the background.
However, there are instances that the app might crash and after that the app
icon in the system tray is still displayed. It goes away when the mouse is
pointed over the icon.
I wonder if there is any way to force system tray refresh during the VB.NET
app crash?

I tried to add some code in the finalize but it didn't do anything. I think
that finalize was not even executed.

Any help is greatly appreciated,
Tom
 
B

Brian Swanson

I think you might be out of luck on this one, as it would appear not
even Microsoft themselves have figured this out. Even today when
Outlook or some other MS app crashes it leaves it's system tray icon in
place until the mouse is passed over the icon. I think this is more of
an Operating System issue than an application issue.

Hope this helps,
Brian Swanson
 
H

Herfried K. Wagner [MVP]

Tom said:
System tray icon informs users that the apps is running in the background.
However, there are instances that the app might crash and after that the
app icon in the system tray is still displayed. It goes away when the
mouse is pointed over the icon.
I wonder if there is any way to force system tray refresh during the
VB.NET app crash?

You may want to write an external application that monitors your
application, removes the icon if your application crashes and restarts your
application.

A VB6 sample can be found here:

<URL:http://www.activevb.de/rubriken/ausschreibungen/03_07_28_systemtray/downloads/systray_final.zip>

Notice that changes must be done in order to use this code in VB.NET.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top