954,498 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Dialog edittext Insert text?

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

tawes01
Light Poster
37 posts since Oct 2010
Reputation Points: 8
Solved Threads: 5
 

Maybe this will help you

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

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?

tawes01
Light Poster
37 posts since Oct 2010
Reputation Points: 8
Solved Threads: 5
 

Figured it out:

SendMessage(GetDlgItem(hMainDlg, IDC_EDIT1), EM_REPLACESEL, 0, (LPARAM)text_to_insert);
tawes01
Light Poster
37 posts since Oct 2010
Reputation Points: 8
Solved Threads: 5
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: