Private Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As LongPrivate Type POINTAPI x As Long y As Long End Type Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As LongPrivate Declare Function SetCapture Lib "user32"(ByVal hwnd As Long) As Long Private Declare Function ReleaseCapture Lib "user32" () As LongPrivate Sub Command_MouseMove(……) Static NextMove As Boolean
Dim hCursorWnd As Long, point As POINTAPI
GetCursorPos point hCursorWnd = WindowFromPoint(point.x, point.y) If Command.hWnd = hCursorWnd Then SetCapture Command.hWnd If NextMove=False Then MsgBox "……" End If NextMove=True Else ReleaseCapture NextMove=False End IfEnd Sub
msgbox "mousemove","test",64
end sub
ToolTip属性
用ToolTip属性或者在MouseMove事件中编程
x As Long
y As Long
End Type
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As LongPrivate Declare Function SetCapture Lib "user32"(ByVal hwnd As Long) As Long
Private Declare Function ReleaseCapture Lib "user32" () As LongPrivate Sub Command_MouseMove(……)
Static NextMove As Boolean
Dim hCursorWnd As Long, point As POINTAPI
GetCursorPos point
hCursorWnd = WindowFromPoint(point.x, point.y)
If Command.hWnd = hCursorWnd Then
SetCapture Command.hWnd
If NextMove=False Then
MsgBox "……"
End If
NextMove=True
Else
ReleaseCapture
NextMove=False
End IfEnd Sub