News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

How to append in a simple text dialog?

Started by gabor, May 25, 2005, 08:58:15 AM

Previous topic - Next topic

gabor

Hi!

I want to create a simple text logging edit control in a dialog. My main code is doing its stuff and I'd like to put from time to time some results on this edit control.
My problem is that I've only found the SetWindowText API function that overwrites the whole text buffer of the edit control. This is wrong since I would like to append the text, not to overwrite it.
I thought of getting the already outputted text via GetWindowText into a local buffer, appending it there, and then writing the new text via SetWindowText into the edit control's buffer...This would be really brute force solution and I wouldn't like it. (However this wouldn't be unusuall of Microsoft Windows at all...)

Is there any other way to write directly into the buffer of the edit control? Or am I totally wrong? Please add your comments!

Greets, gábor


Tedd

I usually do it this way..

invoke SendMessage, hEdit,EM_SETSEL,-1,-1                  ;move caret to end of text
invoke SendMessage, hConsOut,EM_REPLACESEL,FALSE,lpBuff    ;append the new text
invoke SendMessage, hConsOut,EM_SCROLLCARET,NULL,NULL      ;scroll down if needed

No snowflake in an avalanche feels responsible.

gabor

Thanks!

Now, that's what I expected... A nice work around. However It wouldn't be stupid to have an append method, it would almost disapear among the many and many methods and procs in the API.

Ok, I'll try your solution!

Greets, gábor