Private Sub form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
X = X / Screen.TwipsPerPixelX
Select Case X
Case WM_LBUTTONDOWN
Caption = "Left Click"
Case WM_RBUTTONDOWN
Caption = "Right Click"
Case WM_MOUSEMOVE
Caption = "Move"
Case WM_LBUTTONDBLCLK
Caption = "Double Click"
End Select
End Sub
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
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
guidItem As GUID
End Type
Private Enum TrayIcon_Mouse
TRAYICON_MOUSE_MOVE = 0
TRAYICON_MOUSE_LEFTDOWN = 1
TRAYICON_MOUSE_LEFTUP = 2
TRAYICON_MOUSE_LEFTDBLCLICK = 3
TRAYICON_MOUSE_RIGHTDOWN = 4
TRAYICON_MOUSE_RIGHTUP = 5
TRAYICON_MOUSE_RIGHTDBLCLICK = 6
End Enum
Private Sub lForm_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Select Case (X And &HFF) / Screen.TwipsPerPixelX
Case TRAYICON_MOUSE_LEFTDBLCLICK
RaiseEvent DblClick(1)
Case TRAYICON_MOUSE_LEFTDOWN
RaiseEvent MouseDown(1)
Case TRAYICON_MOUSE_LEFTUP
RaiseEvent MouseUp(1)
Case TRAYICON_MOUSE_RIGHTDBLCLICK
RaiseEvent DblClick(2)
Case TRAYICON_MOUSE_RIGHTDOWN
RaiseEvent MouseDown(2)
Case TRAYICON_MOUSE_RIGHTUP
RaiseEvent MouseUp(2)
Case TRAYICON_MOUSE_MOVE
RaiseEvent MouseMove
End Select
End Sub
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 100