The MASM Forum

General => The Campus => Topic started by: ragdog on February 03, 2015, 09:51:44 PM

Title: Riched
Post by: ragdog on February 03, 2015, 09:51:44 PM
Hello

I use a Riched control in my project but i search a function to overwrite my text in the the control

example:

I have a text  "123456789"

Now need i a overwrite function

I set the cursel to the "123456789" and add a new text 1777777

But my control make 177777723456789 it move the text after 1 to right

I found only this but he has the same problem to found a solution.
http://www.asmcommunity.net/forums/topic/?id=25290

example a hexeditor the Acsii column make it

Have any an idea how i can make it with a Riched
Title: Re: Riched
Post by: hutch-- on February 03, 2015, 09:55:50 PM
You need to select the text first.
Title: Re: Riched
Post by: ragdog on February 03, 2015, 09:57:13 PM
How i can make it with EM_GETSEL or EM_EXGETSEL?
Title: Re: Riched
Post by: jj2007 on February 04, 2015, 01:08:45 AM
EM_EXSETSEL

stx   SETTEXTEX <ST_DEFAULT or ST_SELECTION or ST_KEEPUNDO, CP_ACP>   ; flags, codepage

      invoke SendMessage, hAux, EM_EXSETSEL, 0, addr chrg      ; set selection
      invoke SendMessage, hAux, EM_SETTEXTEX, addr stx, edi      ; and replace with new text