Thread: How do I get text from an edit box?

  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
    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
    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-05-2010, 11:42 PM
  2. Retrieving the text from an edit box
    By chrishowarth in forum Windows Programming
    Replies: 13
    Last Post: 05-13-2007, 06:57 PM
  3. Capture Enter key press in EDIT Box
    By richiev in forum Windows Programming
    Replies: 4
    Last Post: 07-14-2005, 12:03 AM
  4. Edit Box Questions PT. II
    By Quantrizi in forum Windows Programming
    Replies: 16
    Last Post: 08-12-2003, 10: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, 09:45 PM