Edit Box Questions PT. II

This is a discussion on Edit Box Questions PT. II within the Windows Programming forums, part of the Platform Specific Boards category; If hEdit is a global variable, or the GetWindowText() is in the WM_CREATE message thing right under the CreateWindow(), I ...

  1. #16
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    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
    Location
    near a computer
    Posts
    3,859
    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

    ID(entifier)E(dit)_(function)

    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

Page 2 of 2 FirstFirst 12
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, 09:34 PM
  4. Edit Control Questions
    By Jaken Veina in forum Windows Programming
    Replies: 2
    Last Post: 04-18-2005, 06:34 PM
  5. Edit box question
    By learning110 in forum Windows Programming
    Replies: 6
    Last Post: 03-28-2003, 08:16 PM

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