View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default capturing mouse positions at any moment

Hi Bob
I should have thought that you'll provide some API calls :-)
What kind of event are you using to update the satus bar? OnTime
method?

--
Regards
Frank Kabel
Frankfurt, Germany


Bob Phillips wrote:
Hi Shrinu,

Here is some code to return the mouse position as a simple function .

Private Declare Function GetCursorPos Lib "user32" _
(lpPoint As POINTAPI) As Long

Private Type POINTAPI
x As Long
y As Long
End Type

Sub test()
Dim pPosition As POINTAPI
Dim lReturn As Long

lReturn = GetCursorPos(pPosition)
MsgBox "Cursor position is:" & vbCrLf & _
"x co-ordinate: " & pPosition.x & vbCrLf & _
"y co-ordinate: " & pPosition.y

End Sub

I also have some code that dynamically returns the mouse position
into the status bar. Post back if that would be useful.


"Shrinu" wrote in message
m...
Hi,

I need to find out the position of a mouse at any given moment ,

i.e
without any event happening, is this possible. If yes ,how can i do
that. Please help me on this.
Thanks in advance.

Regards
Shrinu