My application creates tray icon but when I close my application that icon still remains in system tray until I move mouse cursor close to that icon.
Is there any way so that the sys tray icon gets removed after my application close.
Printable View
My application creates tray icon but when I close my application that icon still remains in system tray until I move mouse cursor close to that icon.
Is there any way so that the sys tray icon gets removed after my application close.
Do you have the code to delete the icon from there in Form unload or Query Unload event? If so, this happends just when running from VB IDE and stoping execution from VB IDE because it forces the Form to close whithout processing that events. Close the Form from your app and this shouldn't happen, this is how it will always work when the app is compiled.
just see this attachment...
What kind of tray icon are you using? Third party OCX?
Your program might be crashing when it closes (i.e. not closing properly). I notice that if my vb app crashes, the icon will stay there until i mouse over it. Double check that it's not crashing.
I use DevPower Tray Icon. It's free and it's super easy to use (it includes balloon tips as well)! http://www.devpower.com/trayicon/home.aspx
If you don't put:in the Form_QueryUnload the icon stays till you turn off your computer. And whereVB Code:
t.cbSize = Len(t) t.hWnd = Me.hWnd t.uId = 1& Shell_NotifyIcon &H2, t Me.Refresh
this is in module:MortenVB Code:
Private Type NOTIFYICONDATA cbSize As Long hWnd As Long uId As Long uFlags As Long ucallbackMessage As Long hIcon As Long szTip As String * 64 End Type Dim t As NOTIFYICONDATA Private Declare Function Shell_NotifyIcon Lib "shell32" Alias _ "Shell_NotifyIconA" (ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean
thanks for reply
"in the Form_QueryUnload the icon stays till you turn off your computer. And where
this is in module"
now i am getting new problem i am not able write code in form unload or terminate these events are not seems to be working . don't know why.. :(
Never heared of. Not able to write? Or app passing without trigging what is written?Quote:
Originally Posted by xor83
that's write events not trigging
My application is an addon and sometimes when main application crashes my application tray menu still remains.
Is this the exe of you application. Then you have a problem. I remember when the app (attached) was only running in debug mode. I had to move the mousepointer over the TrayIcon to make it disappear.
The DaysWork is made to make you able to show how much time you're logged on (on monthly base). All data is stored in registry to remain private. But has to be empty through printing out or deleted. It has an extra routine to remember 'NumLock' was on or off (Windows 2k did not?). That's why KEYSTA32.OCX is a part.
The exe from this has never let me stay with an icon in tray after ending.
Pick what you want!