System Tray Icon blank

sachmo

Member
Joined
Aug 2, 2007
Messages
14
Programming Experience
Beginner
Hey, I have code to place my icon in the system tray and it works, however, for some reason my icon is not showing in the system tray. I know that it is there because a blank space is made for it (i.e., an invisible icon appears to be present in my system tray), and I have balloon tips attached which show the balloon tip over where the icon should be in the system tray.

VB.NET:
 ' place form in system tray
        With uNIF
            .cbSize = Marshal.SizeOf(uNIF)
            .hwnd = Me.Handle
            .uID = 1
            .dwInfoFlags = NIF_ICON Or NIF_MESSAGE
            .uCallbackMessage = New IntPtr(&H500)
            .uVersion = NOTIFYICON_VERSION
            .hIcon = Me.Icon.Handle
        End With
        Result = Shell_NotifyIcon(NIM_ADD, uNIF)

TIA
 
Get rid of that code altogether. Just add a NotifyIcon component to your form in the designer. You can set its properties and handle its events to make it look and behave as you want.
 
Back
Top