B
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
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