(Resolved by Serge) Gurus - Em_CharFromPos
Is EM_CHARFROMPOS available in Windows 2000? I am using this code:
VB Code:
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const EM_CHARFROMPOS& = &HD7
Public Type POINTAPI
x As Long
y As Long
End Type
Public Function WordUnderCursor(txtBox As TextBox, x As Single, y As Single) As String
Dim mPosAs POINTAPI
Dim cPos As Integer
mPos.x = x / Screen.TwipsPerPixelX
mPos.y = y / Screen.TwipsPerPixelY
cPos = SendMessage(txtBox.hWnd, EM_CHARFROMPOS, 0&, mPos)
etc.......
cPos is always returned as -1. Also I cannot find EM_CHARFROMPOS in the API Viewer.
Does anyone have any ideas?
TIA
-TiPeRa