Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


editbox control/scrolling in winAPI

This topic is 5922 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Kinda n00b-ish at winAPI, but is there anyway to simply append strings to an editbox control like you can with a listbox? I couldn''t find a way to do so since the SetDlgItemText() function overwrites the current value with whatever its sent. So my temporary solution was to pushback every new string to be entered onto an array of strings, then loop through, add each to one large, cumulative string with newlines etc added and send it to the function. (this can''t be the best way to do that....) Now since it just gets a huge string that increases in size, the scrollbar resets to the top each time instead of staying current with the most recently "appended" line of text like I want. Is there a better way, or am I gonna have to try to reset the scroll bar to maximum every time....

Share this post

Link to post
Share on other sites
Ok - this is a bit strange for a noobie as it requires that you
send messages to the edit control

DWORD start,finish;
char* to_add=" this is added";

HWND hEdit= GetDlgItem(m_hWnd,IDC_EDIT1);

// first find the end of the line


// set the current selection to the end


// insert the text


Hope this helps, if not then you realy need to look at the windows messages starting with EM_

Share this post

Link to post
Share on other sites
No its not strange at all ^_^. I''m familiar with message sending basics and EM_ messages etc but looking through those and the explanations offered I became kinda confused. (I was almost there too) But that works great though, thanks a lot.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!