Windows How to make Program with the ability to highlight the text with the mouse (Cursor)

I've been making a lot of programs and they have been going well however I cannot make the text that has been drawn "highlightable" like you would be able to in Microsoft Word, Notepad, or other software which deals with characters. Is there are particular code which can enable me to highlight the characters with the cursor. Any help is greatly appreciated. mouse_highlight.png
 

TheouAegis

Member
How are you tracking where the text is? In my interactive text code, I kept track of every string by row, translated the mouse_y to a row, fetched the string for that row, then compared the mouse_x to its position in the string. ...It wasn't super efficient, but it worked well enough. So I'd expand on that idea. ...Or google a code in C++ or Python. lol
 
Top