Hello all, How would i get VB to report the position of the mouse pointer? Thanks, Liam :o)
L Liam Oct 26, 2006 #1 Hello all, How would i get VB to report the position of the mouse pointer? Thanks, Liam )
G Gary''s Student Oct 26, 2006 #2 Declare Function GetCursorPos Lib "user32" _ (lpPoint As POINTAPI) As Long Type POINTAPI X As Long Y As Long End Type Sub ShowPos() Dim lRetVal As Long Dim Pos As POINTAPI lRetVal = GetCursorPos(Pos) MsgBox Pos.X & ", " & Pos.Y End Sub The mouse doesn't even need to be in the application window.
Declare Function GetCursorPos Lib "user32" _ (lpPoint As POINTAPI) As Long Type POINTAPI X As Long Y As Long End Type Sub ShowPos() Dim lRetVal As Long Dim Pos As POINTAPI lRetVal = GetCursorPos(Pos) MsgBox Pos.X & ", " & Pos.Y End Sub The mouse doesn't even need to be in the application window.
J John Oct 26, 2006 #3 Hi Gary, Do you know of a good web source for details of calling Windows API functions from VBA? Best regards John
Hi Gary, Do you know of a good web source for details of calling Windows API functions from VBA? Best regards John
J John Oct 26, 2006 #5 Perfect. Thanks Gary. John Gary''s Student said: Start here, just for example: http://www.xcelfiles.com/Index.html Click to expand...
Perfect. Thanks Gary. John Gary''s Student said: Start here, just for example: http://www.xcelfiles.com/Index.html Click to expand...