'on a Module Form
Type POINTAPI
x as
Integer
Y as
Integer
End Type
Type ConvertPOINTAPI
xy as
Long
End Type
Declare Function SendMessage Lib "User" (ByVal hWnd as
Integer, ByVal wMsg as
Integer, ByVal wParam as
Integer, ByVal lParam as
Any) as
Long
Declare sub
GetCursorPos Lib "User" (lpPoint as
POINTAPI)
Global Const WM_LBUTTONUP = &H202
Global Const WM_SYSCOMMAND = &H112
Global Const MOUSE_MOVE = &HF012
'put this in the mousedown event of the control(s)
'in this case it's a picturebox
Sub Picture1_MouseDown (Button as
Integer, shift
as
Integer, X as
Single, Y as
Single)
dim
mpos as
POINTAPI
dim
p as
ConvertPOINTAPI
dim
ret as
Integer
Call GetCursorPos(mpos)
LSet p = mpos
ret = SendMessage(picture1.hWnd, WM_LBUTTONUP, 0, p.xy)
ret = SendMessage(Me.hWnd, WM_SYSCOMMAND, MOUSE_MOVE, p.xy)
End Sub
Return