Basically, I have written a program in C# that grabs text and the current caret position from any window handle using user32.dll. After manipulating the text, the program sets the text of the control to the new string and also resets the caret position.
The issue I am running into is that EM_GETSEL
returns an caret position for RichEdit controls based on the number of CR+LF proceeding the caret position.
Edit controls treat these as two characters, while RichEdit controls treat them as one "character".
Is there anyway that I can detect which of these two a control may be by windows messages?
Or is there a better way that I can detect caret position for unmanaged controls?