tuopan.bas
资源名称:qq.rar [点击查看]
上传用户:luoweizhao
上传日期:2022-08-01
资源大小:1290k
文件大小:4k
源码类别:
外挂编程
开发平台:
Visual Basic
- Attribute VB_Name = "tuopan"
- Option Explicit
- '使用高分辨率图标所用的API
- Public Const LR_LOADFROMFILE = &H10
- Public Const LR_LOADMAP3DCOLORS = &H1000
- Public Const IMAGE_ICON = 1
- '系统托盘
- Declare Function Shell_NotifyIcon Lib "shell32.dll" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, lpData As NOTIFYICONDATA) As Long
- Public Const NIF_MESSAGE = &H1
- Public Const NIF_ICON = &H2
- Public Const NIF_TIP = &H4
- Public Const NIF_STATE = &H8
- Public Const NIF_INFO = &H10
- Public Const NIM_ADD = &H0
- Public Const NIM_MODIFY = &H1
- Public Const NIM_DELETE = &H2
- Public Const NIM_SETFOCUS = &H3
- Public Const NIM_SETVERSION = &H4
- Public Const NIM_VERSION = &H5
- Public Const WM_USER As Long = &H400
- Public Const NIN_BALLOONSHOW = (WM_USER + 2)
- Public Const NIN_BALLOONHIDE = (WM_USER + 3)
- Public Const NIN_BALLOONTIMEOUT = (WM_USER + 4)
- Public Const NIN_BALLOONUSERCLICK = (WM_USER + 5)
- Public Const NOTIFYICON_VERSION = 3
- Public Const NIS_HIDDEN = &H1
- Public Const NIS_SHAREDICON = &H2
- Public Const WM_NOTIFY As Long = &H4E
- Public Const WM_COMMAND As Long = &H111
- Public Const WM_CLOSE As Long = &H10
- Public Const WM_MOUSEMOVE As Long = &H200
- Public Const WM_LBUTTONDOWN As Long = &H201
- Public Const WM_LBUTTONUP As Long = &H202
- Public Const WM_LBUTTONDBLCLK As Long = &H203
- Public Const WM_MBUTTONDOWN As Long = &H207
- Public Const WM_MBUTTONUP As Long = &H208
- Public Const WM_MBUTTONDBLCLK As Long = &H209
- Public Const WM_RBUTTONDOWN As Long = &H204
- Public Const WM_RBUTTONUP As Long = &H205
- Public Const WM_RBUTTONDBLCLK As Long = &H206
- Public Enum bFlag
- NIIF_NONE = &H0
- NIIF_INFO = &H1
- NIIF_WARNING = &H2
- NIIF_ERROR = &H3
- NIIF_GUID = &H5
- NIIF_ICON_MASK = &HF
- NIIF_NOSOUND = &H10 '关闭提示音标志
- End Enum
- Private Type NOTIFYICONDATA
- cbSize As Long
- hwnd As Long
- uID As Long
- uFlags As Long
- uCallbackMessage As Long
- hIcon As Long
- szTip As String * 128
- dwState As Long
- dwStateMask As Long
- szInfo As String * 256
- uTimeoutAndVersion As Long
- szInfoTitle As String * 64
- dwInfoFlags As Long
- End Type
- '鼠标事件
- Public Enum TrayRetunEventEnum
- MouseMove = &H200
- LeftUp = &H202
- LeftDown = &H201
- LeftDbClick = &H203
- RightUp = &H205
- RightDown = &H204
- RightDbClick = &H206
- MiddleUp = &H208
- MiddleDown = &H207
- MiddleDbClick = &H209
- BalloonClick = (WM_USER + 5)
- End Enum
- Public ni As NOTIFYICONDATA
- Public Sub TrayAddIcon(ByVal MyForm As Form, ByVal ToolTip As String, Optional ByVal bFlag As bFlag)
- With ni
- .cbSize = Len(ni)
- .hwnd = MyForm.hwnd
- .uID = vbNull
- .uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
- .uCallbackMessage = WM_MOUSEMOVE
- .hIcon = Form1.Icon
- .szTip = ToolTip & vbNullChar
- End With
- Call Shell_NotifyIcon(NIM_ADD, ni)
- End Sub
- Public Sub TrayRemoveIcon()
- Shell_NotifyIcon NIM_DELETE, ni
- End Sub
- Public Sub TrayBalloon(ByVal MyForm As Form, ByVal sBaloonText As String, sBallonTitle As String, Optional ByVal bFlag As bFlag)
- With ni
- .cbSize = Len(ni)
- .hwnd = MyForm.hwnd
- .uID = vbNull
- .uFlags = NIF_INFO
- .dwInfoFlags = bFlag
- .szInfoTitle = sBallonTitle & vbNullChar
- .szInfo = sBaloonText & vbNullChar
- End With
- Shell_NotifyIcon NIM_MODIFY, ni
- End Sub
- Public Sub TrayBalloon1(ByVal MyForm As Form, ByVal sBaloonText As String, sBallonTitle As String, Optional ByVal bFlag As bFlag, Optional yzm As Boolean)
- With ni
- .cbSize = Len(ni)
- .hwnd = MyForm.hwnd
- .uID = vbNull
- .uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
- .dwInfoFlags = bFlag
- .szInfoTitle = sBallonTitle & vbNullChar
- .szInfo = sBaloonText & vbNullChar
- If yzm = True Then
- .hIcon = Main.Icon
- Else
- .hIcon = Form1.Icon
- End If
- End With
- Shell_NotifyIcon NIM_MODIFY, ni
- End Sub
- Public Sub TrayTip(ByVal MyForm As Form, ByVal sTipText As String)
- With ni
- .cbSize = Len(ni)
- .hwnd = MyForm.hwnd
- .uID = vbNull
- .uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
- .szTip = sTipText & vbNullChar
- End With
- Shell_NotifyIcon NIM_MODIFY, ni
- End Sub