resolved!
insert text to the end of the line where the cursor is located
How to take the text insertion point as the coordinate
GetCaretXY
insert text to the end of the line where the cursor is located
int lineStart = SendMessage(h EM_LINEINDEX line 0)
int lineLength = SendMessage(h EM_LINELENGTH line 0)
int lineEnd = lineStart + lineLength
SendMessage(h EM_SETSEL lineStart lineEnd)
How to take the text insertion point as the coordinate
GetCaretXY