By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,857 Members | 1,793 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,857 IT Pros & Developers. It's quick & easy.

System Tray Help Please

P: n/a
BJ
I am trying to add my application to the system tray. I am
not using the built in control becuase of the limitation
that you can not use the balloon tool tip feature. I have
done this succesfully in vb6 but when I try it in vb.net I
get the system tray to work but there is no icon in the
system tray. I know it is working because I can get the
balloon tip to appear and where the icon is supposed to be
there just isn't an icon. just a blank space. I am going
nuts as to why I can't get an icon to show up. Plus how do
I handle the user clicking on the icon? In vb 6 I used to
put .uCallbackMessage = WM_MOUSEMOVE in the NOTIFYICONDATA
data structure...now this does not work. And neither does
popUpMenu. I am really curious as to why this was so easy
in vb6 but now it is almost impossible to do in vb.net.
Btw just to test I have used the built in control and my
icon adds to the taskbar that way. Can anyone help me out
please. Here is my code

With uNIF
.cbSize = Marshal.SizeOf(uNIF)
.hwnd = Me.Handle
.uID = 1
.dwInfoFlags = NIF_ICON Or NIF_MESSAGE
.uCallbackMessage = New IntPtr(&H500) <-- WHAT
SHOULD GO HERE?
.uVersion = NOTIFYICON_VERSION
.hIcon = Me.Icon.Handle <-- DOES NOT WORK
End With
Result = Shell_NotifyIcon(NIM_ADD, uNIF)
With uNIF
.uFlags = NIF_INFO
.uVersion = 2000
.szInfoTitle = "Test"
.szInfo = "Testing 1,2,3 Testing"
.dwInfoFlags = NIIF_INFO
End With
Result = Shell_NotifyIcon(NIM_MODIFY, uNIF)

Thanks in advance.

BJ
Nov 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
On Thu, 11 Dec 2003 08:14:07 -0800, BJ wrote:
I am trying to add my application to the system tray. I am
not using the built in control becuase of the limitation
that you can not use the balloon tool tip feature. I have

Try these links:

http://www.codeproject.com/useritems...get=NotifyIcon

http://www.codeproject.com/csharp/no...get=NotifyIcon
--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.
Nov 20 '05 #2

P: n/a
These are all for C#. Is there anything for VB.NET???

Thanks again.
-----Original Message-----
On Thu, 11 Dec 2003 08:14:07 -0800, BJ wrote:
I am trying to add my application to the system tray. I am not using the built in control becuase of the limitation that you can not use the balloon tool tip feature. I
have

Try these links:

http://www.codeproject.com/useritems...otifyIconEx.as p?target=NotifyIcon
http://www.codeproject.com/csharp/notifyballoon.asp? target=NotifyIcon

--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mailaddress.
.

Nov 20 '05 #3

P: n/a
On Thu, 11 Dec 2003 09:44:48 -0800, <an*******@discussions.microsoft.com>
wrote:
These are all for C#. Is there anything for VB.NET???

Thanks again.
-----Original Message-----
On Thu, 11 Dec 2003 08:14:07 -0800, BJ wrote:
I am trying to add my application to the system tray. I am not using the built in control becuase of the limitation that you can not use the balloon tool tip feature. I

have


Try these links:

http://www.codeproject.com/useritems...otifyIconEx.as

p?target=NotifyIcon

http://www.codeproject.com/csharp/notifyballoon.asp?

target=NotifyIcon


--
Chris

To send me an E-mail, remove the underscores and

lunchmeat from my E-Mail
address.
.


There may be on CodeProject, but I didn't really look for them. I just
thought that those would give you some hint. I think one of them is a
control, so you can just reference it in your project and use it (I may be
wrong about that, however).

You can also try this one. It's not strictly a NotifyIcon, but you may be
able to use it. Also C# but a full control that you can call from VB.Net.
It has a VB.Net project included.
--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.
Nov 20 '05 #4

P: n/a
On Thu, 11 Dec 2003 09:44:48 -0800, <an*******@discussions.microsoft.com>
wrote:
These are all for C#. Is there anything for VB.NET???

Thanks again.
-----Original Message-----
On Thu, 11 Dec 2003 08:14:07 -0800, BJ wrote:
I am trying to add my application to the system tray. I am not using the built in control becuase of the limitation that you can not use the balloon tool tip feature. I

have


Try these links:

http://www.codeproject.com/useritems...otifyIconEx.as

p?target=NotifyIcon

http://www.codeproject.com/csharp/notifyballoon.asp?

target=NotifyIcon


--
Chris

To send me an E-mail, remove the underscores and

lunchmeat from my E-Mail
address.
.


Here's one more, for VB.Net

http://www.dnzone.com/ShowDetail.asp?NewsId=334
--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.
Nov 20 '05 #5

P: n/a
I used to do the same thing in VB6. In .NET use the
NotifyIcon component (under Window Forms in the toolbox).
You can set the Icon property to the desired icon and the
Text property to the desired tooltip. There are events
for Click, DoubleClick, MouseDown, MouseOver, and MouseUp.
-----Original Message-----
I am trying to add my application to the system tray. I amnot using the built in control becuase of the limitation
that you can not use the balloon tool tip feature. I havedone this succesfully in vb6 but when I try it in vb.net Iget the system tray to work but there is no icon in the
system tray. I know it is working because I can get the
balloon tip to appear and where the icon is supposed to bethere just isn't an icon. just a blank space. I am going
nuts as to why I can't get an icon to show up. Plus how doI handle the user clicking on the icon? In vb 6 I used toput .uCallbackMessage = WM_MOUSEMOVE in the NOTIFYICONDATAdata structure...now this does not work. And neither doespopUpMenu. I am really curious as to why this was so easyin vb6 but now it is almost impossible to do in vb.net.
Btw just to test I have used the built in control and my
icon adds to the taskbar that way. Can anyone help me outplease. Here is my code

With uNIF
.cbSize = Marshal.SizeOf(uNIF)
.hwnd = Me.Handle
.uID = 1
.dwInfoFlags = NIF_ICON Or NIF_MESSAGE
.uCallbackMessage = New IntPtr(&H500) <-- WHATSHOULD GO HERE?
.uVersion = NOTIFYICON_VERSION
.hIcon = Me.Icon.Handle <-- DOES NOT WORK
End With
Result = Shell_NotifyIcon(NIM_ADD, uNIF)
With uNIF
.uFlags = NIF_INFO
.uVersion = 2000
.szInfoTitle = "Test"
.szInfo = "Testing 1,2,3 Testing"
.dwInfoFlags = NIIF_INFO
End With
Result = Shell_NotifyIcon(NIM_MODIFY, uNIF)

Thanks in advance.

BJ
.

Nov 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.