andreww
01-13-2002, 07:07 AM
this is what i am using
------------------------------------------------------------------------------------
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 Integer
y As Integer
End Type
Dim MousePoint As POINTAPI
------------------------------------------------------------------------------------
GetCursorPos MousePoint
ScreenToClient Picture1.hwnd, MousePoint
------------------------------------------------------------------------------------
this is to get the mouse pointers position within a picture1 box
but my problem is that I have scaled the picture box like this
Board.Scale (0, 0)-(6, 6)
but the mouse position outputted from the code above gives only in pixels, not in the scale that i have set
does anyone know how to fix this? or is there another method?
basically i want to be able to move a mousepointer around some tiles and everytime the pointer is in a tile to beable to detect which tile it is in.
------------------------------------------------------------------------------------
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 Integer
y As Integer
End Type
Dim MousePoint As POINTAPI
------------------------------------------------------------------------------------
GetCursorPos MousePoint
ScreenToClient Picture1.hwnd, MousePoint
------------------------------------------------------------------------------------
this is to get the mouse pointers position within a picture1 box
but my problem is that I have scaled the picture box like this
Board.Scale (0, 0)-(6, 6)
but the mouse position outputted from the code above gives only in pixels, not in the scale that i have set
does anyone know how to fix this? or is there another method?
basically i want to be able to move a mousepointer around some tiles and everytime the pointer is in a tile to beable to detect which tile it is in.