I have this text on my richeditor.
I'd like to add a command such "Add bold" to insert string, like this:Code:Hello world
I know How to get the start and end chars with EM_EXGETSEL, but how to insert strings?Code:<b>Hello</b> world
Thanks
I have this text on my richeditor.
I'd like to add a command such "Add bold" to insert string, like this:Code:Hello world
I know How to get the start and end chars with EM_EXGETSEL, but how to insert strings?Code:<b>Hello</b> world
Thanks
* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with xfce4.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with xfce4.
You could try using EM_EXSETSEL to set the selection so that it begins and ends at the place you want to insert text, and then use EM_SETTEXTEX to insert the text.
The procedure should be the same as with a regular edit control, except using EM_EXSETSEL instead of EM_SETSEL and EM_SETTEXTEX instead of EM_REPLACESEL.
Info on the EM_SETTEXTEX message:
http://msdn2.microsoft.com/en-gb/library/ms652188.aspx
Typing stuff in Code::Blocks 8.02, compiling stuff with MinGW 3.4.5.