Code:
Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean
Public Type NOTIFYICONDATA
cbSize As Long
hWnd As Long
uId As Long
uFlags As Long
ucallbackMessage As Long
hIcon As Long
szTip As String * 64
End Type
Sub Icon_Add(Name As NOTIFYICONDATA, Icn As Object, Txt As String)
Name.cbSize = Len(Name)
Name.hWnd = form11.hWnd
Name.uId = vbNull
Name.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
Name.ucallbackMessage = WM_MOUSEMOVE
Name.hIcon = Icn
Name.szTip = Txt & Chr$(0)
Call Shell_NotifyIcon(NIM_ADD, Name)
End Sub
here's an example of how to use that cub:
Code:
Dim try as NOTIFYICONDATA
Call Icon_Add(try,Picture1.Picture,"Text")