CaretPos vs. CharacterPos
I am trying to figure out a way to "insert" text in an editbox, but doing this programatically, using the current position of the editbox.
The MSDN states that CaretPos can be used to determine the current position of the Caret, eg.
POINT ptChr;
ptChr = m_edit_Action.GetCaretPos();
so in turn
ptChr.x <- will give me the current caret position of the editbox, but unfortunately the .x member of this current position points to an actual coordinate.
How would I know where in the editbox the caretpos is ... so that I could manipulate the insertion of text as follows ...
CString strInsertText("");
m_edit_Action.GetWindowText(strInsertText);
strInsertText.Insert(<Get current character position>, "INSERT TEXT");
m_edit_Auction.SetWindowText(strInsertText);
Actual text of the editbox ->
ABC<The Caret is currently at the postion, after character 2, and before character 3>DEFG
an the GetCaretPos() members returns 65 (which is actually pixels, or the actual x coordinate of the caret).
[b]So how will I programarically be able to know that the caret is currently between character 2 and 3 ... ??
Thanx in advance ...
xIRC