Standard Editbox, Editable?

This is a discussion on Standard Editbox, Editable? within the Windows Programming forums, part of the Platform Specific Boards category; Well i dont know if the standard Edit box is what i need.. But like in HTML, you know how ...

  1. #1
    #junkie
    Join Date
    Oct 2004
    Posts
    240

    Standard Editbox, Editable?

    Well i dont know if the standard Edit box is what i need.. But like in HTML, you know how you can have a simple username input? I want that in my box, but with the following code you cannot edit your name, nor can you see a boarder around the text edit spot.
    Code:
                hMainEit = CreateWindow("EDIT", NULL, 
                    WS_CHILD | WS_VISIBLE | ES_LEFT, 
                    5, 
                    25, 
                    100, 
                    20, 
                    hwnd, (HMENU) ID_MAIN_EDIT, (HINSTANCE) GetWindowLong(hwnd, GWL_HINSTANCE), NULL);
                CHAR lpszTrouble[] = "Zeusbwr";
                SendMessage(hMainEit, WM_SETTEXT, 0, (LPARAM) lpszTrouble);
    Ya.. i should think it would just be a simple style i have to add.. but again, on the Edit Control Styles page on MSDN i see nothing to make it editable.. I can make it Read Only with ES_READONLY, but i want edit.. any ideas on what i am doing wrong?
    (Note: i tried a few dif Styles just randomly guessing at what might work, nothing i tried did. I thought maybe the ES_READONLY would toggle edit mode, but it doesent. Instead it adds a colored background (not boarder) around my text, but i still cant edit..)

    Here is a link to the editbox type i am using.
    http://msdn.microsoft.com/library/de...itcontrols.asp
    01110111011000010110110001100100011011110010000001 11000101110101011010010111010000100000011011000110 10010110011001100101001000000111100101101111011101 0100100000011011100111010101100010

  2. #2
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,812
    Is this what you are talking about?
    Attached Images Attached Images  
    Woop?

  3. #3
    #junkie
    Join Date
    Oct 2004
    Posts
    240
    Ya, and i have that (well something similar, i dunno what control you are using), but the problem is i cannot edit it.


    And i have no clue why, it cant be a style or something, because i had the same one MSDN has (multi lines, ect..) and i still couldent edit.


    Big thanks to help
    01110111011000010110110001100100011011110010000001 11000101110101011010010111010000100000011011000110 10010110011001100101001000000111100101101111011101 0100100000011011100111010101100010

  4. #4
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Could you post the rest of the code demonstrating the problem? I'd guess there is something wrong in your message loop or window procedure.

  5. #5
    #junkie
    Join Date
    Oct 2004
    Posts
    240
    Here is the main cpp, resource not in it but its a mega small resource and its compiling, so there cant be a bug with that right? lol.

    Anyways, this is a test file and the message loop is a bit different than i normally use, this is a new "project" so i just havent changed it (simply deleting != to > lol). Anyway, here

    Thanks!


    *edit* and the C++ format is just somethin new i picked up, any comments on that are welcome too! (Got from a tutorial)
    Attached Files Attached Files
    01110111011000010110110001100100011011110010000001 11000101110101011010010111010000100000011011000110 10010110011001100101001000000111100101101111011101 0100100000011011100111010101100010

  6. #6
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Code:
                SendMessage(hMainEit, EM_SETLIMITTEXT, 0, 10);
    You've got your arguments mixed up. See EM_SETLIMITTEXT. The wParam should specify the maximum number of characters and lParam should be zero. You are limiting your edit control to zero characters.

  7. #7
    #junkie
    Join Date
    Oct 2004
    Posts
    240
    Ya well that was one of my shotty attempts to get it to work. But umm, you mean like this?
    Code:
    SendMessage(hMainEit, EM_SETLIMITTEXT, 10, 0);
    ?
    because that still doesent work.. And i removed it all together and still i cannot edit my box. I was pretty sure it wasent working before that line, but its still not working..

    Any advice? I tried the code i posted, nothing, i tried removing it all together, and nothing..

    Any idea?
    01110111011000010110110001100100011011110010000001 11000101110101011010010111010000100000011011000110 10010110011001100101001000000111100101101111011101 0100100000011011100111010101100010

  8. #8
    #junkie
    Join Date
    Oct 2004
    Posts
    240
    found the problem, there wasent a TranslateMessage in my message loop, i didnt notice because i was using a template i setup and aparently it was a bit old lol.

    Thanks for your help
    01110111011000010110110001100100011011110010000001 11000101110101011010010111010000100000011011000110 10010110011001100101001000000111100101101111011101 0100100000011011100111010101100010

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Bug in iterator comparison in C++ standard?
    By steev in forum C++ Programming
    Replies: 14
    Last Post: 07-12-2008, 01:02 AM
  2. Abstract Base Class and References
    By Thantos in forum C++ Programming
    Replies: 9
    Last Post: 10-13-2004, 02:35 PM
  3. editbox problem
    By tyouk in forum Windows Programming
    Replies: 7
    Last Post: 10-05-2004, 10:14 PM
  4. im extreamly new help
    By rigo305 in forum C++ Programming
    Replies: 27
    Last Post: 04-24-2004, 12:22 AM
  5. include question
    By Wanted420 in forum C++ Programming
    Replies: 8
    Last Post: 10-17-2003, 04:49 AM

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