How do you go about refreshing the system tray? I have an icon in the system tray, and when my app closes the icon stays there until I drag my mouse over it. Any tips or hints?
Brenton, the system tray does not refresh itself very well after an app closes, god knows why not..
This code should (and we emphasize SHOULD) remove the icon from the tray for you.. It uses Shell_NotifyIconA. (I
Don't Worry, I had this problem on many an occasion, as i suppose many others have!
I got the code from somewhere a while back, don't know where though sorry...
[tt]
Private Declare Function Shell_NotifyIconA Lib "shell32.dll" (ByVal dwMessage As Long, lpData As NOTIFYICONDATA) As Integer
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
[/tt]
Hope this helps...
[tt]"Do not put off until tomorrow what you cannot put off until the day after tomorrow just as well." - Mark Twain[/tt]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.