Private Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Dim a As RECT
Private Sub Command1_Click()
GetWindowRect Me.hwnd, a
SetCursorPos a.Left + 5, a.Top + 20
End Sub