I've tried quite a few different approaches, to moving the Caret at the beginning of a specified line, but I can only seem to get it to work for one line, and for the rest, it moves to random places in that line. How would I go about moving the caret to the beginning of a line?

I'm using EM_SETSEL to set its location.

I've tried using EM_LINELENGTH to get the number of TCHAR's in each line, then adding one to move to the next line, and repeat for each line until I reach my designated line, but this only really works for the second line, and no more lines than that.