• Advertisement


This topic is now archived and is closed to further replies.

help with editboxes and gettin lines

This topic is 5455 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Let's say I'm typing in an editbox, on some line, and I hit return.. I want to get that line before it goes to the next one.. below is my buggy code.
to create:

     WS_CHILD|WS_VISIBLE | ES_MULTILINE,                      
     (HWND)hwnd,(HMENU) 801,GetModuleHandle(NULL),NULL);

then to grab the line:

    lLine = SendMessage(client, EM_LINEFROMCHAR, -1, 0);  //Get the char pos of beginning of line

    lLineIndex = SendMessage(client, EM_LINEINDEX, lLine+1, 0); //Get the length of the line

    lLen = SendMessage(client, EM_LINELENGTH, lLine+1, 0);
    SelStart = lLineIndex;
    SelLength = lLen;
    if (lLen==0) exit(0);
    SendMessage(client, EM_GETLINE, (WPARAM)lLine, (LPARAM) stng);     
BTW shouldn't the UBB be code and NOT source?? I fseek, therefore I fam. [edited by - drarem on April 17, 2003 11:53:22 PM] [edited by - drarem on April 17, 2003 11:54:02 PM]

Share this post

Link to post
Share on other sites

You''ll need to setup some message filtering I think, that should enable you to capture return key presses. (that notification should help you get started) I haven''t tried it and there might be an easier way. I was thinking ES_WANTRETURN would work but it appears not, that just makes the multi-line work like a multiline rather than a single line.

Share this post

Link to post
Share on other sites

  • Advertisement