|
-
Apr 30th, 2007, 08:10 PM
#1
Thread Starter
Fanatic Member
Other System Tray Icons Question!...
I was wondering if it were possible to remove the icons from Other programs in the system tray?
How would i go about this?
For example with Hamachi, it's a useful program and all that, but the icon does get annoying down there, especially if there's alot of other icons. Would it be possible to remove the icon so that you'd have to open it again to display Hamachi (This is why i want to make this application).
Last edited by Slyke; Apr 30th, 2007 at 08:31 PM.
-
Apr 30th, 2007, 10:09 PM
#2
Thread Starter
Fanatic Member
Re: Other System Tray Icons Question!...
I was thinking about this and would getting the hWnd of Hamachi & removing the icon as you would when you are removing your own program.
Would this possibly work? I cannot test this at the moment.
Also how would one get the hWnd of Hamachi (since it's hidden).
This is a general question, but the program is being made for Hamachi.
-
May 1st, 2007, 04:42 AM
#3
Thread Starter
Fanatic Member
Re: Other System Tray Icons Question!...
Is someone going to help?
Here's the code that i got so far:
vb Code:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean
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
Private Const NIM_ADD = &H0
Private Const NIM_MODIFY = &H1
Private Const NIM_DELETE = &H2
Private Const NIF_MESSAGE = &H1
Private Const NIF_ICON = &H2
Private Const NIF_TIP = &H4
Private Const WM_LBUTTONDBLCLK = &H203
Private Const WM_LBUTTONDOWN = &H201
Private Const WM_RBUTTONUP = &H205
Dim TrayI As NOTIFYICONDATA
Private Sub CmdFind_Click()
hWndTxt.Text = FindWindow(vbNullString, "Hamachi")
Shell_NotifyIcon NIM_ADD, TrayI
End Sub
Private Sub CmdHide_Click()
TrayI.cbSize = Len(TrayI)
TrayI.hWnd = hWndTxt.Text
TrayI.uId = 1&
Shell_NotifyIcon NIM_DELETE, TrayI
End Sub
The problem is that the Icon keeps comming back now (for some reason). Is there some way to stop this?
-
May 1st, 2007, 05:53 AM
#4
New Member
Re: Other System Tray Icons Question!...
maybe a timer can do this. I mean if the Icon comes back every continually, the timer can execute the Sub you've written (for example) every 4 or 5 seconds
-
May 1st, 2007, 06:37 AM
#5
Thread Starter
Fanatic Member
Re: Other System Tray Icons Question!...
Yes, but the icon will appear up & then vanish (which is annoying & using system resources).
-
Aug 30th, 2007, 07:29 PM
#6
Lively Member
Re: Other System Tray Icons Question!...
i was also trying to do something similar but instead of removing the system tray icons i was trying to restore the application by double clicking the icon. however, i can't find the window since it is hidden into the tray. also, i'm thinking ahead of myself but if i can manage to actually find the icon, what if i have 2 instances of it running?
can anyone shed some light on this?
-
Aug 30th, 2007, 10:46 PM
#7
Fanatic Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|