Reading an EditBox control

This is a discussion on Reading an EditBox control within the Windows Programming forums, part of the Platform Specific Boards category; I have the next multi-line Editbox control: Code: CreateWindowEx(NULL, "Edit", "", WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_MULTILINE ...

  1. #1
    * Death to Visual Basic * Devil Panther's Avatar
    Join Date
    Aug 2001
    Posts
    768

    Reading an EditBox control

    I have the next multi-line Editbox control:
    Code:
    CreateWindowEx(NULL, "Edit", "", WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL
                             | ES_AUTOVSCROLL | ES_MULTILINE | WS_TABSTOP, 101, 165, 366, 148, hwnd,
                             (HMENU)IDC_EDIT_MSGBODY, GetModuleHandle(NULL), NULL);
    What I would like to do is to be able to read the text one line at a time, or something like that, but not the entire thing all at once. Is this possible?


    Thank you.
    "I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe

    http://www.Bloodware.net - Developing free software for the community.

  2. #2
    Even death may die... Dante Shamest's Avatar
    Join Date
    Apr 2003
    Location
    Malaysia
    Posts
    970
    I think you can do it by using the EM_GETLINE message.

  3. #3
    * Death to Visual Basic * Devil Panther's Avatar
    Join Date
    Aug 2001
    Posts
    768
    I've looked through the control messages, but couldn't find any way I could read a set number of chars into a buffer, can I do that?


    thanks again.
    "I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe

    http://www.Bloodware.net - Developing free software for the community.

  4. #4
    Even death may die... Dante Shamest's Avatar
    Join Date
    Apr 2003
    Location
    Malaysia
    Posts
    970
    Quote Originally Posted by Devil Panther
    I've looked through the control messages, but couldn't find any way I could read a set number of chars into a buffer, can I do that?
    Quote Originally Posted by Dante Shamest
    I think you can do it by using the EM_GETLINE message.
    Maybe I'm misunderstanding you, but if what you want to do is read a line from the edit control into a buffer (of which the size you specify), EM_GETLINE will do it.

  5. #5
    * Death to Visual Basic * Devil Panther's Avatar
    Join Date
    Aug 2001
    Posts
    768
    i want to read number of lines at sames time to the same buffer, with a single message, if possible
    Last edited by Devil Panther; 08-20-2005 at 02:00 PM.
    "I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe

    http://www.Bloodware.net - Developing free software for the community.

  6. #6
    Registered /usr
    Join Date
    Aug 2001
    Location
    Newport, South Wales, UK
    Posts
    1,255
    Copy the buffer pointer, use a for loop and increment the pointer by the return value (you may also need to add "\r\n" on the end).

    To do it all in a single message, subclass the edit control, make a new message (using a value above WM_USER) and do as above.

  7. #7
    * Death to Visual Basic * Devil Panther's Avatar
    Join Date
    Aug 2001
    Posts
    768
    i see. thank you.
    "I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe

    http://www.Bloodware.net - Developing free software for the community.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Appending to an edit control
    By TheDan in forum Windows Programming
    Replies: 2
    Last Post: 03-31-2006, 11:27 AM
  2. creating an activex control
    By Benzakhar in forum Windows Programming
    Replies: 9
    Last Post: 12-29-2003, 05:32 PM
  3. Updating a list control
    By MPSoutine in forum Windows Programming
    Replies: 2
    Last Post: 12-05-2003, 01:03 AM
  4. Problems with my edit control...
    By tyouk in forum Windows Programming
    Replies: 19
    Last Post: 10-19-2003, 12:36 AM
  5. \n\r in an editbox control???
    By Devil Panther in forum Windows Programming
    Replies: 1
    Last Post: 07-18-2003, 04:18 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21