Hi Everybody,
Is there a way to add multiple lines to an edit box? I can create a multiline edit box and assign text to it. But when I add more text it overwrites the current text.
...
sLoadMsg db 'Loading Picture One...', 10, 13, 0
sSaveMsg db 'Saving Picture One...', 10, 13, 0
...
...
invoke SendMessage, hEdit, WM_SETTEXT, 0, addr sLoadMsg
invoke SendMessage, hEdit, WM_SETTEXT, 0, addr sSaveMsg
...
Is there another API call for this?
Regards,
L.
invoke SendMessage, hEdit, EM_SETSEL, -1, 0 ; select end of current text
invoke SendMessage, hEdit, EM_REPLACESEL, 0, chr$("appended")
for appending lines:
MLEditAddLineA proc uses ebx esi hWnd:HANDLE,psz:ptr BYTE
.repeat
mov esi,rv(SendMessage,hWnd,WM_GETTEXTLENGTH,0,0)
add esi,len(psz)
lea esi,[esi+3]
.break .if !ASM(mov ebx,alloc(esi))
.if rv(SendMessage,hWnd,WM_GETTEXT,esi,ebx)
invoke szCatStr,ebx,chr$(13,10)
.endif
invoke szCatStr,ebx,psz
invoke SendMessage,hWnd,WM_SETTEXT,0,ebx
free(ebx)
mov eax,esi
.until
ret
MLEditAddLineA endp
Thanks guys.... That works Ok for me...