Thread: Getting string from text box

  1. #1
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584

    Getting string from text box

    I am a programmer in C. I have not yet started to program Windows in C, but my curiousity has been aroused. How would you get a string from a text box, let's say, when the use clicks the command, "Convert"? Thanks.
    1978 Silver Anniversary Corvette

  2. #2
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    By using GetDlgItemText().

  3. #3
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584
    What library is that in? Windows.h? Thanks.
    1978 Silver Anniversary Corvette

  4. #4
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    Yeah, it's declared in a header file that's included in windows.h. Check MSDN for details.

  5. #5
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584
    Thanks! Oh, and thanks for the link. I was looking for a site that had the resources for libraries. Thanks again!
    1978 Silver Anniversary Corvette

  6. #6
    Registered User morbuz's Avatar
    Join Date
    Aug 2001
    Posts
    35

    Unhappy Confused...

    Can anyone post a small code snippet that shows how GetDlgItemText() is used?

    I would really appreciate it...
    [Signature here. (Remove this!)]

  7. #7
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    This is from a logon dialog.

    //*******************************
    case IDC_USERNAME:

    if (EN_CHANGE == HIWORD(wParam))
    {
    GetDlgItemText(hwnd,IDC_USERNAME,sName,STRING);
    }
    break;
    //*******************************

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. RicBot
    By John_ in forum C++ Programming
    Replies: 8
    Last Post: 06-13-2006, 06:52 PM
  2. Replies: 4
    Last Post: 03-03-2006, 02:11 AM
  3. New Theme
    By XSquared in forum A Brief History of Cprogramming.com
    Replies: 160
    Last Post: 04-01-2004, 08:00 PM
  4. 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
  5. Warnings, warnings, warnings?
    By spentdome in forum C Programming
    Replies: 25
    Last Post: 05-27-2002, 06:49 PM