![]() |
WIN32 API - Appending text in an EDIT box
I was wondering if there is a WINAPI function that allows you to append text to text that is already in an EDIT box, or would I have to create my own function to do this? thanks for any help.
Im using Dev C++ on Win XP. brent |
You can use the EM_REPLACESEL message after setting the caret to the end of the edit control using EM_SETSEL (I think start of -1 and end of 0 does it, but I can't remember for sure).
|
Alright, thanks i'll try that and see how it works out.
|
The Dark, your idea worked great, but another problem popped up. Whenever I click the Edit box, the program exits. What could be causing this.
|
Without looking at your code, I have no idea, sorry.
|
Yea, my bad, I dont have the code with me at the moment but I will post it.
|
Completely random stab in the dark... Might you be missing a break statement such that the code which handles a left click runs on into a block for handling close messages or something similar?
|
Hmmm, thats interesting, i'll take a look at my code.
|
1 Attachment(s)
Ok, I have checked the code over and I didnt see any missing breaks, and I have attached the source for anyone who wants to take a look.
|
I can't run through your code without the resource.h file (and the other resource files), but here are a few suspicious items:
1. :
SendDlgItemMessage(hwnd,IDC_ALL_MSG_BOX,EM_SETSEL,-1,(LPARAM)-1);2. :
return NOT;3. :
for(a=0;a<=sizeof(new_name);a++)Other than that, I can only suggest running the program through a debugger, setting a breakpoint on the EM_REPLACESEL lines and stepping through from there. |
| All times are GMT -5. The time now is 2:28 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC