Farenin Pozisyonunu Bulmak ve Değiştirmek
(Modul)(General)(Declaration)
Type PointApi
X As Long
Y As Long
End Type
Global FareXY As PointApi
Declare Function GetCursorPos Lib "user32" (lpPoint As PointApi) As Long
Declare Function SetCursorPos Lib "user32" (ByVal x As Long, _
ByVal y As Long) As Long
Private Sub Form_Click() ‘ Farenin yeri
Z = GetCursorPos(PointApi)
MsgBox "Fare Pozisyonu : (" & FareXY.Y & "," & FareXY.Y & ") "
End Sub
Private Sub Command1_Click() ‘ Farenin yerini değiştirmek
X = Val(InputBox("X ?"))
Y = Val(InputBox("Y ?"))
Z = SetCursorPos(x, y)
MsgBox "Fare Pozisyonu: (" & X & "," & Y & ")"
End Sub