Member Avatar

tawes01

I'm making a dialog based text editor, using dev-c++. how can I insert text at the current cursor position? as in get the location of the cursor (not the mouse) and insert text at that point in the edittext control

Member Avatar

tawes01

Thank you, that got me to a point where I can get the text and add text into it (insert). But how do you find where the cursor/typing thingy is? and is there a simpler method of doing this?

Member Avatar

tawes01

Figured it out:

SendMessage(GetDlgItem(hMainDlg, IDC_EDIT1), EM_REPLACESEL, 0, (LPARAM)text_to_insert);