Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Position of the mouse pointer

Hello all,

How would i get VB to report the position of the mouse pointer?

Thanks,
Liam :o)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Position of the mouse pointer

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.


--
Gary''s Student


"Liam" wrote:

Hello all,

How would i get VB to report the position of the mouse pointer?

Thanks,
Liam :o)

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default Position of the mouse pointer

Hi Gary,

Do you know of a good web source for details of calling Windows API
functions from VBA?

Best regards

John

"Gary''s Student" wrote in message
...
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.


--
Gary''s Student


"Liam" wrote:

Hello all,

How would i get VB to report the position of the mouse pointer?

Thanks,
Liam :o)



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Position of the mouse pointer

Start here, just for example:

http://www.xcelfiles.com/Index.html
--
Gary''s Student


"John" wrote:

Hi Gary,

Do you know of a good web source for details of calling Windows API
functions from VBA?

Best regards

John

"Gary''s Student" wrote in message
...
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.


--
Gary''s Student


"Liam" wrote:

Hello all,

How would i get VB to report the position of the mouse pointer?

Thanks,
Liam :o)




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default Position of the mouse pointer

Perfect. Thanks Gary.

John


"Gary''s Student" wrote in message
...
Start here, just for example:

http://www.xcelfiles.com/Index.html
--
Gary''s Student


"John" wrote:

Hi Gary,

Do you know of a good web source for details of calling Windows API
functions from VBA?

Best regards

John

"Gary''s Student" wrote in
message
...
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.


--
Gary''s Student


"Liam" wrote:

Hello all,

How would i get VB to report the position of the mouse pointer?

Thanks,
Liam :o)








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Position of the mouse pointer

Start here, just for example:

http://www.xcelfiles.com/Index.html


--
Gary's Student


"John" wrote:

Hi Gary,

Do you know of a good web source for details of calling Windows API
functions from VBA?

Best regards

John

"Gary''s Student" wrote in message
...
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.


--
Gary''s Student


"Liam" wrote:

Hello all,

How would i get VB to report the position of the mouse pointer?

Thanks,
Liam :o)




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cell pointer position rmd Excel Discussion (Misc queries) 3 December 15th 09 03:51 PM
mouse pointer Atishoo Excel Discussion (Misc queries) 2 June 16th 08 04:25 PM
Comment Box Position & Pointer David Excel Discussion (Misc queries) 0 February 7th 06 12:55 AM
Pointer position on opening Jazz Drummer Excel Discussion (Misc queries) 0 October 7th 05 11:33 PM
Mouse pointer position, excel2002 tc Excel Programming 1 May 23rd 05 05:20 PM


All times are GMT +1. The time now is 05:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"