MsgBox "请将鼠标移到 KJ 图标之上以检查'提示信息'是否设定成功!" End SubPrivate Sub Form_Unload(Cancel As Integer) Command2_Click End Sub '模块 Option ExplicitPublic Const NIM_ADD = 0 Public Const NIM_MODIFY = 1 Public Const NIM_DELETE = 2Public Const NIF_MESSAGE = 1 Public Const NIF_ICON = 2 Public Const NIF_TIP = 4Type NOTIFYICONDATA cbSize As Long hWnd As Long uID As Long uFlags As Long uCallbackMessage As Long hIcon As Long szTip As String * 64 End TypeDeclare Function Shell_NotifyIcon Lib "shell32.dll" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, lpData As NOTIFYICONDATA) As Long
Option ExplicitPrivate Sub Command1_Click()
Dim nid As NOTIFYICONDATA
nid.cbSize = Len(nid)
nid.hWnd = Me.hWnd
nid.uID = 9999
nid.uFlags = NIF_ICON
nid.hIcon = Me.Icon
Shell_NotifyIcon NIM_ADD, nid '
End SubPrivate Sub Command2_Click()
Dim nid As NOTIFYICONDATA
nid.cbSize = Len(nid)
nid.hWnd = Me.hWnd
nid.uID = 9999
Shell_NotifyIcon NIM_DELETE, nid
End SubPrivate Sub Command3_Click()
Dim nid As NOTIFYICONDATA
nid.cbSize = Len(nid)
nid.hWnd = Me.hWnd
nid.uID = 9999
nid.uFlags = NIF_ICON
nid.hIcon = Image1.Picture
Shell_NotifyIcon NIM_MODIFY, nid
End SubPrivate Sub Command4_Click()
Dim nid As NOTIFYICONDATA
nid.cbSize = Len(nid)
nid.hWnd = Me.hWnd
nid.uID = 9999
nid.uFlags = NIF_TIP
nid.szTip = "cool qqyy_sj" + Chr(0)
Shell_NotifyIcon NIM_MODIFY, nid
MsgBox "请将鼠标移到 KJ 图标之上以检查'提示信息'是否设定成功!"
End SubPrivate Sub Form_Unload(Cancel As Integer)
Command2_Click
End Sub
'模块
Option ExplicitPublic Const NIM_ADD = 0
Public Const NIM_MODIFY = 1
Public Const NIM_DELETE = 2Public Const NIF_MESSAGE = 1
Public Const NIF_ICON = 2
Public Const NIF_TIP = 4Type NOTIFYICONDATA
cbSize As Long
hWnd As Long
uID As Long
uFlags As Long
uCallbackMessage As Long
hIcon As Long
szTip As String * 64
End TypeDeclare Function Shell_NotifyIcon Lib "shell32.dll" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, lpData As NOTIFYICONDATA) As Long