加个定时器,隔一段时间环图标 ' For show the icon we need know if ' its the first time we call the method Public Function Show() As Integer
Dim nd As NOTIFYICONDATA Dim nRet As Integer
If Not UserControl.Ambient.UserMode Then Exit Function
' For first time we use NIM_ADD ' else we use NIM_MODIFY If mbFirst = False Then With nd .cbSize = Len(nd) .hWnd = UserControl.hWnd .uID = vbNull ' This is necesary for catch the mousemove event ' with our form .uCallbackMessage = WM_MOUSEMOVE .hIcon = UserControl.Picture .szTip = ToolTip & Chr$(0) .uFlags = NIF_ICON Or NIF_MESSAGE Or NIF_TIP End With nRet = Shell_NotifyIconA(NIM_MODIFY, nd) Else With nd .cbSize = Len(nd) .hWnd = UserControl.hWnd .uID = vbNull ' This is necesary for catch the mousemove event ' with our form .uCallbackMessage = WM_MOUSEMOVE .hIcon = UserControl.Picture .szTip = ToolTip & Chr$(0) .uFlags = NIF_ICON Or NIF_MESSAGE Or NIF_TIP End With nRet = Shell_NotifyIconA(NIM_ADD, nd) mbFirst = False End If Show = nRet End Function修改 Shell_NotifyIconA(NIM_MODIFY, nd)
' For show the icon we need know if
' its the first time we call the method
Public Function Show() As Integer
Dim nd As NOTIFYICONDATA
Dim nRet As Integer
If Not UserControl.Ambient.UserMode Then Exit Function
' For first time we use NIM_ADD
' else we use NIM_MODIFY
If mbFirst = False Then
With nd
.cbSize = Len(nd)
.hWnd = UserControl.hWnd
.uID = vbNull
' This is necesary for catch the mousemove event
' with our form
.uCallbackMessage = WM_MOUSEMOVE
.hIcon = UserControl.Picture
.szTip = ToolTip & Chr$(0)
.uFlags = NIF_ICON Or NIF_MESSAGE Or NIF_TIP
End With
nRet = Shell_NotifyIconA(NIM_MODIFY, nd)
Else
With nd
.cbSize = Len(nd)
.hWnd = UserControl.hWnd
.uID = vbNull
' This is necesary for catch the mousemove event
' with our form
.uCallbackMessage = WM_MOUSEMOVE
.hIcon = UserControl.Picture
.szTip = ToolTip & Chr$(0)
.uFlags = NIF_ICON Or NIF_MESSAGE Or NIF_TIP
End With
nRet = Shell_NotifyIconA(NIM_ADD, nd)
mbFirst = False
End If
Show = nRet
End Function修改 Shell_NotifyIconA(NIM_MODIFY, nd)
你不会说是想改windows程序的exe图标吧.