f8g

カーソルの位置

ByValとかByRefとか忘れるなー。

Private Type POINTAPI
    x As Long
    y As Long
End Type

Private Declare Function GetCursorPos Lib "user32" ( _
    ByRef lpPoint As POINTAPI _
) As Long

Private Declare Function SetCursorPos Lib "user32" ( _
    ByVal x As Long, _
    ByVal y As Long _
) As Long

Private Sub Command1_Click()
    Dim cursorPos As POINTAPI

    GetCursorPos cursorPos
    SetCursorPos cursorPos.x + 1, cursorPos.y
    Debug.Print cursorPos.x & ":" & cursorPos.y
End Sub

ボタン押すと1pxずつ右に移動。簡単にできるのか。