W
Walt
Hi,
I use the following in positioning a custom right-click menu (Win XP
XL2002 & 2003). Some users would like to use the application on Macs
and I don't know if this code would work.
'******************** CURSOR POSITION ***************
Private Type CursorPos
Lft As Long
Tp As Long
End Type
Private Declare Function GetCursorPos Lib "user32.dll" (lpPoint As
CursorPos) As Boolean
Function GetCursorTop()
Dim CurCursor As CursorPos
If GetCursorPos(CurCursor) Then GetCursorTop = CurCursor.Tp
End Function
Function GetCursorLeft()
Dim CurCursor As CursorPos
If GetCursorPos(CurCursor) Then GetCursorLeft = CurCursor.Lft
End Function
As I understand, there is a user32 library incliding GetCursorPos with
the Mac / Excel 2004.
******* Maybe something like the following would work?:
Private Type CursorPos
Lft As Long
Tp As Long
End Type
#If Mac Then
Private Declare Function GetCursorPos Lib "user32" (lpPoint As
CursorPos) As Long
Function GetCursorTop()
Dim CurCursor As CursorPos
GetCursorPos (CurCursor)
GetCursorTop = CurCursor.Tp
End Function
Function GetCursorLeft()
Dim CurCursor As CursorPos
GetCursorPos (CurCursor)
GetCursorTop = CurCursor.Lft
End Function
#Else
Private Declare Function GetCursorPos Lib "user32.dll" (lpPoint As
CursorPos) As Boolean
Function GetCursorTop()
Dim CurCursor As CursorPos
If GetCursorPos(CurCursor) Then GetCursorTop = CurCursor.Tp
End Function
Function GetCursorLeft()
Dim CurCursor As CursorPos
If GetCursorPos(CurCursor) Then GetCursorLeft = CurCursor.Lft
End Function
#End If
It seems to work on the PC side, but I can't test it now on the Mac.
Sub test()
MsgBox GetCursorLeft & " ---- " & GetCursorTop
End Sub
Any help with this will be appreciated.
Best Regards,
Walt Weber
I use the following in positioning a custom right-click menu (Win XP
XL2002 & 2003). Some users would like to use the application on Macs
and I don't know if this code would work.
'******************** CURSOR POSITION ***************
Private Type CursorPos
Lft As Long
Tp As Long
End Type
Private Declare Function GetCursorPos Lib "user32.dll" (lpPoint As
CursorPos) As Boolean
Function GetCursorTop()
Dim CurCursor As CursorPos
If GetCursorPos(CurCursor) Then GetCursorTop = CurCursor.Tp
End Function
Function GetCursorLeft()
Dim CurCursor As CursorPos
If GetCursorPos(CurCursor) Then GetCursorLeft = CurCursor.Lft
End Function
As I understand, there is a user32 library incliding GetCursorPos with
the Mac / Excel 2004.
******* Maybe something like the following would work?:
Private Type CursorPos
Lft As Long
Tp As Long
End Type
#If Mac Then
Private Declare Function GetCursorPos Lib "user32" (lpPoint As
CursorPos) As Long
Function GetCursorTop()
Dim CurCursor As CursorPos
GetCursorPos (CurCursor)
GetCursorTop = CurCursor.Tp
End Function
Function GetCursorLeft()
Dim CurCursor As CursorPos
GetCursorPos (CurCursor)
GetCursorTop = CurCursor.Lft
End Function
#Else
Private Declare Function GetCursorPos Lib "user32.dll" (lpPoint As
CursorPos) As Boolean
Function GetCursorTop()
Dim CurCursor As CursorPos
If GetCursorPos(CurCursor) Then GetCursorTop = CurCursor.Tp
End Function
Function GetCursorLeft()
Dim CurCursor As CursorPos
If GetCursorPos(CurCursor) Then GetCursorLeft = CurCursor.Lft
End Function
#End If
It seems to work on the PC side, but I can't test it now on the Mac.
Sub test()
MsgBox GetCursorLeft & " ---- " & GetCursorTop
End Sub
Any help with this will be appreciated.
Best Regards,
Walt Weber