Member Avatar for 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

Recommended Answers

All 3 Replies

Maybe this will help you

Member Avatar for 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 for tawes01

Figured it out:

SendMessage(GetDlgItem(hMainDlg, IDC_EDIT1), EM_REPLACESEL, 0, (LPARAM)text_to_insert);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.