Well, you have to be very careful with this because of the fact that, generally speaking, Scintilla does not really utilise character positions; it deals with byte-positions instead and this can be complicated by the use of, for example, the utf-8 codepage.
The #SCI_GETCOLUMN message does, however, deal with character positions, though of what use this might be when you are probably using a variable width font is unclear?
The #SCI_GETCURLINE message can be used to get the current caret position within the currently selected line, but it will return it as a byte position which, if using UTF-8, for example, will not always equate to a character position. You will need to add some additional code to convert this to a character position.
The following may or may not give you what you are after :
Code: Select all
ScintillaSendMessage(1, #SCI_GETCOLUMN, ScintillaSendMessage(1, #SCI_GETCURRENTPOS))
I may look like a mule, but I'm not a complete ass.