flat assembler
Message board for the users of flat assembler.

Index > Windows > updating an edit control

Author
Thread Post new topic Reply to topic
magicSqr



Joined: 27 Aug 2011
Posts: 105
magicSqr 27 Aug 2011, 09:35
Hi,

If I set the text in a multiline edit control with SetWindowText, it erases what is already in the control.

How do I append text to this control?

Do I have to save the contents to a buffer, append it to the buffer then use SetWindowText (which has the window constantly flashing because of the update) or is there another way?

Many thanks

magicSqr
Post 27 Aug 2011, 09:35
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20405
Location: In your JS exploiting you and your system
revolution 27 Aug 2011, 12:11
magicSqr wrote:
How do I append text to this control?

Do I have to save the contents to a buffer, append it to the buffer then use SetWindowText (which has the window constantly flashing because of the update) ...
AFAIK, yes.
magicSqr wrote:
... or is there another way?
Perhaps manipulating the selection and using EM_REPLACESEL, but I doubt it would be easier or worth the extra effort.
Post 27 Aug 2011, 12:11
View user's profile Send private message Visit poster's website Reply with quote
magicSqr



Joined: 27 Aug 2011
Posts: 105
magicSqr 27 Aug 2011, 12:14
ok, thanks
Post 27 Aug 2011, 12:14
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1657
Location: Toronto, Canada
AsmGuru62 27 Aug 2011, 13:53
If the multiline control is empty initially, then just use EM_REPLACESEL without manipulation a caret or selection (which is caret, basically). At the end of each line add CR/LF if ES_WANTRETURN flag was set when control is created.
Post 27 Aug 2011, 13:53
View user's profile Send private message Send e-mail Reply with quote
magicSqr



Joined: 27 Aug 2011
Posts: 105
magicSqr 27 Aug 2011, 14:40
Sorry asmGuru, I didn't really understand

Quote:
then just use EM_REPLACESEL without manipulation a caret or selection (which is caret, basically).


Yes, the control is initially empty. I'm performing calculations and want to output relevant results to the control as they are found, keeping previous results still showing. basically

Code:
.loop:
    calculate until correct result
    update control
    jmp .loop
    


magicSqr
Post 27 Aug 2011, 14:40
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1657
Location: Toronto, Canada
AsmGuru62 28 Aug 2011, 11:44
Here is the link to EM_REPLACESEL:
http://msdn.microsoft.com/en-us/library/bb761633(v=vs.85).aspx

Just pass parameters as it says there.

(Not all links are parsed properly by the forum. If I put the tags around it - the post is empty.)
Post 28 Aug 2011, 11:44
View user's profile Send private message Send e-mail Reply with quote
magicSqr



Joined: 27 Aug 2011
Posts: 105
magicSqr 28 Aug 2011, 13:08
Brilliant Very Happy

Many thanks for that AsmGuru
Post 28 Aug 2011, 13:08
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.