Io uso il suggerimento di gibra ma mi da l'errore riportato nell'immagine presente nel messaggio precedente:
codice:
Public Sub InitTrayIcon(callback As Object, icon As IPictureDisp, testo As String)

  Rem Il form DEVE essere visibile prima di chiamare la Shell_NotifyIcon
  With NID
    .cbSize = Len(NID)
    .hWnd = callback.hWnd  ''''''''''Qui mi da l'errore!!
    .uID = vbNull
    .uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
    .uCallbackMessage = WM_MOUSEMOVE
    .hIcon = icon.Handle
    .szTip = testo & vbNullChar
  End With
  gbIconInTray = True
  Shell_NotifyIcon NIM_ADD, NID

End Sub


vedi dove ho commentato ('''''''''''Qui mi da l'errore!!) nel codice?ecco mi dice che callback non è impostato.Perchè?


PSreciso nuovamente che ho un MDIForm e non un form normale.Nel form normale tutto funziona,nell'MDIForm no. Ma perchè?