How do I get text from an edit box?

This is a discussion on How do I get text from an edit box? within the Windows Programming forums, part of the Platform Specific Boards category; I have been tinkering with a program lately and have created somewhat of a form by looping through a CreateWindowEx() ...

  1. #1
    Registered User Strider's Avatar
    Join Date
    Aug 2001
    Posts
    149

    How do I get text from an edit box?

    I have been tinkering with a program lately and have created somewhat of a form by looping through a CreateWindowEx() function. It is composed of Edit Boxes(ES_LEFT) and Push Buttons(BS_PUSHBUTTON). My Question is, how do I retreive text that is entered in the Edit Boxes?

    If you need my code I can post it tomorrow, as it is currently on my workstation at work.

    Thanks,

    David
    One Ring to rule them all, One Ring to find them,
    One Ring to bring them all and in the darkness bind them
    In the Land of Mordor where the Shadows lie.

  2. #2
    zen
    zen is offline
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    You can use the HWND's returned from the CreateWindowEx()'s in a call to

    GetWindowText(hwnd,buffer,sizeof(buffer));

    to obtain the text.
    zen

  3. #3
    Registered User Strider's Avatar
    Join Date
    Aug 2001
    Posts
    149
    Thanks, I'll give it a try. I assume, however, that since I am using a for loop to create the form, I will need to use an HWND array?

    David
    One Ring to rule them all, One Ring to find them,
    One Ring to bring them all and in the darkness bind them
    In the Land of Mordor where the Shadows lie.

  4. #4
    zen
    zen is offline
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    Yes, unless you want to have to obtain the handles from the ID's of the edit boxes.
    zen

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. BN_CLICKED, change button style
    By bennyandthejets in forum Windows Programming
    Replies: 13
    Last Post: 07-06-2010, 12:42 AM
  2. Retrieving the text from an edit box
    By chrishowarth in forum Windows Programming
    Replies: 13
    Last Post: 05-13-2007, 07:57 PM
  3. Capture Enter key press in EDIT Box
    By richiev in forum Windows Programming
    Replies: 4
    Last Post: 07-14-2005, 01:03 AM
  4. Edit Box Questions PT. II
    By Quantrizi in forum Windows Programming
    Replies: 16
    Last Post: 08-12-2003, 11:42 PM
  5. Ok, Structs, I need help I am not familiar with them
    By incognito in forum C++ Programming
    Replies: 7
    Last Post: 06-29-2002, 10:45 PM

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