PLease help!!!
Does anyone khow to get the mouse position (X,Y)?
Thanks in ADv
///////////////////////////////
MACMAK
///////////////////////////////
Printable View
PLease help!!!
Does anyone khow to get the mouse position (X,Y)?
Thanks in ADv
///////////////////////////////
MACMAK
///////////////////////////////
check the mouse move event
Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
X & Y is the position
HTH
cksiow
http://vblib.virtualave.net - share our codes
thank you!
but are ther any code to get ONLY a mouse position?
///////////////////////////////
MACMAK
///////////////////////////////
check the GetMouseMovePointsEx API, it might help.
Try the GetCursorPos() API function.
The mouse event is activated only on form.
The Api shree suggested will get mouse everywhere on screen.
If you need an example, add a Bas module to your project
add this code:
module bas code:
Option Explicit
Public Declare Function GetCursorPos Lib "user32" (lpPoint As PointAPI) As Long
Public Type PointAPI
X As Long
Y As Long
End Type
form code:
'on top:
option explicit
Dim Coords As PointAPI
'where you need to get x and y:
GetCursorPos Coords 'getting position
Me.Caption = "Current Mouse Position: " & Coords.X & "," & Coords.Y 'showing
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus.