Click here to Skip to main content
15,921,793 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralPassing in variables to a VB executable Pin
31-May-01 12:46
suss31-May-01 12:46 
GeneralRe: Passing in variables to a VB executable Pin
AndyG3-Jun-01 22:04
AndyG3-Jun-01 22:04 
Question"Unrecognized format"? Pin
Jason Teagle31-May-01 8:15
Jason Teagle31-May-01 8:15 
AnswerRe: Pin
AndyG3-Jun-01 22:16
AndyG3-Jun-01 22:16 
GeneralRe: Pin
Jarek G8-Jun-01 10:41
Jarek G8-Jun-01 10:41 
Generaldeploiying an access project Pin
30-May-01 9:53
suss30-May-01 9:53 
GeneralRe: deploiying an access project Pin
2-Jun-01 8:58
suss2-Jun-01 8:58 
GeneralGetting the Caret Location Pin
30-May-01 4:37
suss30-May-01 4:37 
Hi,

I am trying to retrieve the CaretPosition within a textbox. I have tried the following code within the KeyPress event of the TextBox:

Dim ptCaret As POINTAPI
Dim lPoint As Long
Dim lIndex As Long

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



GeneralRe: Getting the Caret Location Pin
Jason Teagle31-May-01 8:21
Jason Teagle31-May-01 8:21 
GeneralRe: Getting the Caret Location Pin
31-May-01 10:23
suss31-May-01 10:23 
GeneralRe: Getting the Caret Location Pin
Jason Teagle31-May-01 10:36
Jason Teagle31-May-01 10:36 
GeneralRe: Getting the Caret Location Pin
31-May-01 10:45
suss31-May-01 10:45 
GeneralRe: Getting the Caret Location Pin
Jason Teagle31-May-01 10:52
Jason Teagle31-May-01 10:52 
GeneralRe: Getting the Caret Location Pin
31-May-01 11:11
suss31-May-01 11:11 
GeneralRe: Getting the Caret Location Pin
Jason Teagle31-May-01 11:13
Jason Teagle31-May-01 11:13 
Generaltest Pin
28-May-01 20:28
suss28-May-01 20:28 
Generaltest 2 Pin
28-May-01 20:29
suss28-May-01 20:29 
GeneralHi Test Only Pin
7-Jun-01 17:10
suss7-Jun-01 17:10 
GeneralRe: Hi Test Only Pin
Ulf Öhlén7-Jun-01 22:26
Ulf Öhlén7-Jun-01 22:26 
GeneralHi Test Only Pin
7-Jun-01 17:11
suss7-Jun-01 17:11 
QuestionTimer refresh? Pin
Geoff Anderson28-May-01 1:28
Geoff Anderson28-May-01 1:28 
AnswerRe: Timer refresh? Pin
Jarek G8-Jun-01 10:37
Jarek G8-Jun-01 10:37 
GeneralAdding to chart data range Pin
Geoff Anderson28-May-01 1:24
Geoff Anderson28-May-01 1:24 
GeneralRe: Adding to chart data range Pin
Eric Jacobsen20-Jun-02 12:31
Eric Jacobsen20-Jun-02 12:31 
GeneralGeneral System Information Pin
25-May-01 0:22
suss25-May-01 0:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.