Thread: Edit Box Questions PT. II

  1. #16
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    If hEdit is a global variable, or the GetWindowText() is in the WM_CREATE message thing right under the CreateWindow(), I don't know.

    Otherwise, if hEdit is local to the message loop, and you create another HWND called hEdit somewhere else, then novacain is probably right (hEdit = GetDlgItem(hWndMain, EDIT_BOX).

    And you should not be doing, as it sounds like you are:
    SendMessage(EDIT_BOX, ...)

    It should be:
    hEdit = GetDlgItem(hwnd, EDIT_BOX);
    SendMessage(hEdit, ...);

    Hope this helps...
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  2. #17
    train spotter
    Join Date
    Aug 2001
    near a computer
    OK, so hEdit is global. (in which case it will work)

    It appeared to be a local in your code snippets.

    >>#define EDIT_BOX 0x00EB

    I find
    //edit ctrl for the username input
    #define IDE_USERNAME 40001


    easier to understand and order
    (have a look at the resource.h file for the values the compiler uses)
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. edit box
    By beene in forum Windows Programming
    Replies: 3
    Last Post: 11-11-2006, 04:40 AM
  2. WS_HSCROLL in ES_READONLY edit box error
    By Homunculus in forum Windows Programming
    Replies: 4
    Last Post: 02-13-2006, 08:46 AM
  3. How to program a "back" button with MFC
    By 99atlantic in forum Windows Programming
    Replies: 3
    Last Post: 04-26-2005, 08:34 PM
  4. Edit Control Questions
    By Jaken Veina in forum Windows Programming
    Replies: 2
    Last Post: 04-18-2005, 05:34 PM
  5. Edit box question
    By learning110 in forum Windows Programming
    Replies: 6
    Last Post: 03-28-2003, 08:16 PM