VB托盘多行提示
不是用气泡提示的,是直接把鼠标移动到托盘后显示的
可以看图,
解决后追加50分, 展开
Private Declare Function Shell_NotifyIcon Lib "shell32.dll" (ByVal dwMessage As Long, lpData As NOTIFYICONDATA) As Long
Const NIM_ADD = &H0
Const NIM_DELETE = &H2
Const NIF_ICON = &H2
Const NIF_MESSAGE = &H1
Const NIF_TIP = &H4
Const WM_MOUSEMOVE = &H200
Const WM_LBUTTONDBLCLK = &H203
Const WM_RBUTTONDBLCLK = &H206
Const WM_RBUTTONUP = &H205
Private 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
Dim tray As NOTIFYICONDATA
Private Sub Form_Resize()
If WindowState = 1 Then
App.TaskVisible = False
tray.cbSize = Len(tray)
tray.uId = vbNull
tray.hwnd = Form1.hwnd
tray.uFlags = NIF_TIP Or NIF_MESSAGE Or NIF_ICON
tray.uCallBackMessage = WM_MOUSEMOVE
tray.hIcon = Form1.Icon
tray.szTip = "QQ: 你试试位置" & Chr(13) & "声音:已开启" & Chr(13) & "消息提醒框:已开启" & Chr(13) & "会话消息:任务栏头像闪动" & vbNullChar
Shell_NotifyIcon NIM_ADD, tray
Form1.Hide
End If
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single)
Dim msg As Long
msg = x / 15
If msg = WM_LBUTTONDBLCLK Then
App.TaskVisible = True
Form1.WindowState = 0
Form1.Show
Shell_NotifyIcon NIM_DELETE, tray
End If
End Sub
2024-09-19 广告