![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Highly Adaptive Penguin
Join Date: May 2005
Location: United States
Posts: 251
Rep Power: 4
![]() |
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 |
|
|
|
|
|
#2 |
|
Expert Programmer
Join Date: Jun 2005
Posts: 852
Rep Power: 4
![]() |
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).
|
|
|
|
|
|
#3 |
|
Highly Adaptive Penguin
Join Date: May 2005
Location: United States
Posts: 251
Rep Power: 4
![]() |
Alright, thanks i'll try that and see how it works out.
|
|
|
|
|
|
#4 |
|
Highly Adaptive Penguin
Join Date: May 2005
Location: United States
Posts: 251
Rep Power: 4
![]() |
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.
|
|
|
|
|
|
#5 |
|
Expert Programmer
Join Date: Jun 2005
Posts: 852
Rep Power: 4
![]() |
Without looking at your code, I have no idea, sorry.
|
|
|
|
|
|
#6 |
|
Highly Adaptive Penguin
Join Date: May 2005
Location: United States
Posts: 251
Rep Power: 4
![]() |
Yea, my bad, I dont have the code with me at the moment but I will post it.
|
|
|
|
|
|
#7 |
|
Hobbyist Programmer
Join Date: Jun 2006
Location: Ireland
Posts: 152
Rep Power: 3
![]() |
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?
__________________
Visit my website BinaryNotions. |
|
|
|
|
|
#8 |
|
Highly Adaptive Penguin
Join Date: May 2005
Location: United States
Posts: 251
Rep Power: 4
![]() |
Hmmm, thats interesting, i'll take a look at my code.
|
|
|
|
|
|
#9 |
|
Highly Adaptive Penguin
Join Date: May 2005
Location: United States
Posts: 251
Rep Power: 4
![]() |
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.
|
|
|
|
|
|
#10 |
|
Expert Programmer
Join Date: Jun 2005
Posts: 852
Rep Power: 4
![]() |
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. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| OnlineTextEditor.Com! | Sane | Show Off Your Open Source Projects | 43 | Jun 16th, 2006 8:55 AM |
| text edit field in Win32 app. | badbasser98 | C++ | 6 | Jan 9th, 2006 7:12 AM |
| How to detect cursor location and insert text??? | syntax-error | C# | 3 | Jun 30th, 2005 1:42 AM |
| edit a text file | ojschubert | Sed and Awk | 2 | Apr 18th, 2005 8:28 AM |