Attribute VB_Name = "Module2"
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function ScreenToClient Lib "user32" (ByVal hwnd As Long, lpPoint As POINTAPI) As Long

Private Type POINTAPI
    X As Long
    Y As Long
End Type

Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
' positionne le curseur de la souris
' Dim Retour As Long
' Retour = SetCursorPos( 10, 10)



Type CadPoint
    X As Single
    Y As Single
   
End Type



'-----------Selection,Grille, Snap et ZOom--------------------------

Dim GridStart As CadPoint
Dim Echelle_X As Single
Dim Echelle_Y As Single

Private Function GetMousePosition() As POINTAPI

Dim pos As POINTAPI

GetCursorPos pos
ScreenToClient Me.hwnd, pos
pos.X = Screen.TwipsPerPixelX * pos.X
pos.Y = Screen.TwipsPerPixelY * pos.Y
GetMousePosition = pos

End Function
