Comments are available to members only. Sign up or Log in to view these comments.
Main Topics
Browse All TopicsIs there any way I can use VB to hide a specific system tray icon? I found this API code that will hide the whole collection of tray icons, but I can't seem to figure out how to pull a single icon out of this so I can hide it.
Public Function HideTaskBarIcons()
Dim FindClass As Long, Handle As Long
FindClass& = FindWindow("Shell_TrayWnd"
Handle& = FindWindowEx(FindClass&, 0, "TrayNotifyWnd", vbNullString)
ShowWindow Handle&, 0
End Function
I also found this code that I think I can modify to do what I want, but I haven't figured out how exactly to get the buttons to hide. I had to modify the API calls like this to get the list to work:
http://www.visualbasiccode
hWndTray = FindWindow("Shell_TrayWnd"
hWndTray2 = FindWindowEx(hWndTray, 0, "TrayNotifyWnd", vbNullString)
hWndTray3 = FindWindowEx(hWndTray2, 0, "SysPager", vbNullString)
hWndToolBar = FindWindowEx(hWndTray3, 0, "ToolbarWindow32", vbNullString)
I tried adding a For..Next loop to go through all the buttons, it finds the button I want to hide, but I haven't figured out how exactly to hide it. Either that, or the system tray needs to be refreshed or something after it's hidden.
Dim Ob As IAccessible
AccessibleObjectFromWindow
For iBtnIndex = 0 To iTrayButtonsCount
If Ob.accName(Av(iBtnIndex)) = "PeerGuardian" Then
SendMessage hWndToolBar&, TB_HIDEBUTTON, iBtnIndex, 0
SendMessage hWndToolBar&, TB_SAVERESTOREA, True, vbNull
End If
Next iBtnIndex
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: ArkPosted on 2005-04-26 at 15:31:33ID: 13871392
Comments are available to members only. Sign up or Log in to view these comments.