Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
tc tc is offline
external usenet poster
 
Posts: 1
Default Mouse pointer position, excel2002

I give up. How do I retrieve the x-y coordinates of the HotSpot within the
active window? I've been struggling with this forever.

Tony Rizzo


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default Mouse pointer position, excel2002

'Put this bit at the top of your code window:

Declare Function GetUserName Lib "ADVAPI32.DLL" Alias "GetUserNameA" _
(ByVal lpBuffer As String, nSize As Long) As Long
'adapted from a sub by Vasant
'used by Module_PopUp sub to get the mouse coordinates when a cell is
clicked
Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As
Long
Type POINTAPI
X As Long
Y As Long
End Type

'used by Module_PopUp sub to get the mouse coordinates when a cell is
clicked
Function ShowPos() As Variant
Dim lRetVal As Long
Dim Pos As POINTAPI
Dim TempArray(1 To 2) As Long
lRetVal = GetCursorPos(Pos)
TempArray(1) = Pos.X
TempArray(2) = Pos.Y
ShowPos = TempArray
End Function

regards
Paul

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 robnsd Excel Discussion (Misc queries) 2 April 20th 07 10:17 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 jim c. Excel Programming 0 September 6th 03 11:25 PM


All times are GMT +1. The time now is 09:30 PM.

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

About Us

"It's about Microsoft Excel"