As you are in the Scripting forum, I am relating to that here. You will have to figure out the C++ code from the FDK yourself.
There is not a lot to tease my brain with this. You get the paragraph where the cursor is and retrieve the text plus line ends via the GetText() method, using a bit field that includes both FTI_String and FTI_LineEnd. Each line end has a modifier that tells you whether it is a hard or a soft return. You also get the offset in the paragraph of the current cursor position and then create the required strings from the array of text items returned by the GetText method.
If you want full running code, ask someone to program it for you and be prepared to pay for the work.
Thanks people, I have done it.
Problem solved. Thanks.