|
-
April 11th, 2001, 02:57 PM
#1
Getting the Caret Location
Hi,
I am trying to retrieve the CaretPosition within a textbox. I have tried the following code:
GetCaretPos ptCaret
lPoint = (ptCaret.y * 65536) + (ptCaret.x And &HFFFF&)
lIndex = SendMessage(txtPrice.hwnd, EM_CHARFROMPOS, 0, lPoint)
If lIndex And &H8000& then
nCharIndex = lIndex Or &HFFFF0000
else
nCharIndex = lIndex And &HFFFF&
End If
GetCaretPos returns the correct x,y coordinates, but SendMessage always returns -1.
Any ideas????
Chris Mancini
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|