I'm trying to append text lines with this code
SendMessage(Form1.log.Handle, WM_SETTEXT, 0, Integer(PChar(textLog)));
// textLog are some lines eg 'Program started at xxx' etc
but it doesnt append, just set new text
I'm trying to append text lines with this code
SendMessage(Form1.log.Handle, WM_SETTEXT, 0, Integer(PChar(textLog)));
// textLog are some lines eg 'Program started at xxx' etc
but it doesnt append, just set new text
It is recommended that you do not use EM_SETSEL or EM_REPLACESEL. Because on newer operating systems like vista and windows 7, the UAC, will prevent you from sending these messages. I suggest you to. 1. Obtain the handle of the window element 2. Do a setfocus, this will position your cursor in the textarea 3. Then you should use SendInput, this will not have any problems with UAC
Hope it helps.
WM_SETTEXT
will replace the entire content; either read the current content, append your new text & set the lot or ensure the caret is at the point you wish to append to and add the new text withEM_REPLACESEL
.Found complete solution
Or better: