Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

System Tray help

Status
Not open for further replies.

Brenton

Technical User
Jul 29, 2002
43
US
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...


jgjge3.gif


[tt]"Do not put off until tomorrow what you cannot put off until the day after tomorrow just as well." - Mark Twain[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top