[API]
Public NOTIFYICONDATA
Shell_NotifyIconA
Shell_NotifyIconW

[INCLUDE]
PokeS

[CODE]
#If LoadResEx_WindowIcon Then
  Public Sub Shell_NotifyIconEx(ByVal dwMessage As Long, ByVal lpData As Long)
    If IsUnicode Then
      If dwMessage = 1& And Shell_NotifyIconW(dwMessage, ByVal lpData) = 0& Then
        Call Shell_NotifyIconW(2&, ByVal lpData)
        Call Shell_NotifyIconW(0&, ByVal lpData)
        End If
      Else
      If dwMessage = 1& And Shell_NotifyIconA(dwMessage, ByVal lpData) = 0& Then
        Call Shell_NotifyIconA(2&, ByVal lpData)
        Call Shell_NotifyIconA(0&, ByVal lpData)
        End If
      End If
    End Sub
  #End If

Public Sub Shell_NotifyIcon(ByVal dwMessage As Long, lpData As NOTIFYICONDATA)
  Call PokeS(VarPtr(lpData.Reserved_szTip(0)), lpData.ToolTip, 64&, True)
#If LoadResEx_WindowIcon Then
  lpData.Reserved_cbsize = 88& - 64& * CLng(IsUnicode)
  Call Shell_NotifyIconEx(dwMessage, VarPtr(lpData))
  If dwMessage = 2& Then lpData.Reserved_cbsize = 0&
#Else
  If IsUnicode Then
    lpData.Reserved_cbsize = 88& + 64&
    If dwMessage = 1& And Shell_NotifyIconW(dwMessage, lpData) = 0& Then
      Call Shell_NotifyIconW(2&, lpData)
      Call Shell_NotifyIconW(0&, lpData)
      End If
    Else
    lpData.Reserved_cbsize = 88&
    If dwMessage = 1& And Shell_NotifyIconA(dwMessage, lpData) = 0& Then
      Call Shell_NotifyIconA(2&, lpData)
      Call Shell_NotifyIconA(0&, lpData)
      End If
    End If
#End If
  End Sub
