Jump to content
  • Advertisement

Archived

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

Floru

For Win32 API gurus...

This topic is 6936 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

Hi! I have problem which no one has solved yet... I''m using Visual C++ 6 and I am programming in C. If I create a Edit Box with following flags: WS_CHILD / WS_VISIBLE / WS_HSCROLL / WS_VSCROLL / WS_BORDER / ES_LEFT / ES_MULTILINE / ES_READONLY / ES_AUTOHSCROLL / ES_AUTOVSCROLL How can I add text to my edit box through my program not by user (ES_READONLY)??? Is something wrong with my flags? I''ve managed to put something to edit box with sending a message of type WM_SETTEXT... The problem is that the text is not right and when I try to add some more text it always starts from the beginning... Please could someone help??? Thanks Floru

Share this post


Link to post
Share on other sites
Advertisement
Look at the EM_* series of messages (those specific to edit controls.) For example EM_REPLACESEL will insert and replace text in the edit box at the given selection.

Tim

Share this post


Link to post
Share on other sites
Try SetWindowText() with the HWND of the edit box. I don''t know the code to add something to it, but an easy fix would be 1) to get the old string (calling GetWindowText), 2) copy that string into a new buffer that is big enough for the old string plus the new string you want to add, 3) copy the new string in the buffer directly after the old one, and 4) call SetWindowText() with the buffer. If you are going to be adding things all the time, just create one array of the maximum size you''ll need and use that as the buffer each time instead of allocating a new one.




- null_pointer
Sabre Multimedia

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!