News:

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

SetDlgItemText

Started by RedXVII, February 02, 2006, 05:38:43 PM

Previous topic - Next topic

RedXVII

Yo!

I want to add to edit box text (like printf) not set edit box text; but all i can find is SetDlgItemText

Anyone know how to do this?

:U

MickD

Try this, you need to pass the function the resource ID of the edit box control. In this case, IDC_EDIT.

invoke SetDlgItemText,hWnd,IDC_EDIT,ADDR TestString

To get the text you would use

invoke GetDlgItemText,hWnd,IDC_EDIT,ADDR buffer,512

Cheers,
Mick

ramguru

There is no direct way to append some text to existing [If you mean that] and no way to use some template like %c-%c to set text [If you mean that]. At the moment I'm working on single line edit control .. some things may change  :lol

MickD

ramguru is correct and I wasn't quite sure if you wanted to 'add' text to the end or just 'put' text so I added the GetDlgItemText, that way you can append the new text to the end and 'set' it again.
I think that's the only easy way it can be done.

Tedd

EM_SETSEL,-1,-1
EM_REPLACESEL
:U

(the setsel just makes sure the cursor is at the end of the text - otherwise you could 'insert' in the middle or start)
No snowflake in an avalanche feels responsible.

gabor

Damn!

Tedd, you were faster than me!  :bg

BTW, about edit text control there are many posts on the forum. To search is never a stupid way of getting info.

Greets, Gábor