| View previous topic :: View next topic |
| Author |
Message |
kitterz Grandmaster Cheater Supreme
Reputation: 0
Joined: 24 Dec 2007 Posts: 1268
|
Posted: Sun Jun 08, 2008 7:59 pm Post subject: C++ with sendmessage(); |
|
|
Hi. I made a text box....
| Code: | | ScriptWin = CreateWindow("EDIT", "" , WS_CHILD | WS_VISIBLE | ES_MULTILINE | WS_HSCROLL | WS_VSCROLL | ES_WANTRETURN, 5, 5, 600, 400, hWnd,(HMENU)ID_ScriptWin, NULL, NULL); |
then i want to write to it
| Code: | | SendMessage(ScriptWin, WM_SETTEXT, 0, (LPARAM)(LPCTSTR)text2show.c_str()); |
text2show = string so i need the c_str()
my question is:
How I make it append the string into the textbox instead of overiding the whole thing?
Thanks.
|
|
| Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Sun Jun 08, 2008 8:04 pm Post subject: |
|
|
| WEll you read whats in the textbox and then add to what you write.
|
|
| Back to top |
|
 |
Bizarro I post too much
Reputation: 0
Joined: 01 May 2007 Posts: 2648
|
Posted: Sun Jun 08, 2008 8:16 pm Post subject: |
|
|
| Code: |
std::string extra = "more";
text2show.append(extra);
SetDlgItemText(hWnd, ID_ScriptWin, text2show);
|
_________________
w8 baby.com Banner contest, Come join NOW!!
Check us out for Prize deatils |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8588 Location: 127.0.0.1
|
Posted: Sun Jun 08, 2008 8:42 pm Post subject: |
|
|
Read the text from the box first, and append it to the string you are adding to it. You can use SendMessage with WM_GETTEXT and WM_GETTEXTLENGTH to accomplish what you need.
_________________
- Retired. |
|
| Back to top |
|
 |
kitterz Grandmaster Cheater Supreme
Reputation: 0
Joined: 24 Dec 2007 Posts: 1268
|
Posted: Sun Jun 08, 2008 8:56 pm Post subject: |
|
|
Thanks all!
@Bizzaro ---> Thanks
|
|
| Back to top |
|
 |
|