Web Analytics Made Easy -
StatCounter Getting Edit Box Value - CodingForum

Announcement

Collapse
No announcement yet.

Getting Edit Box Value

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Getting Edit Box Value

    How do you get the value of an edit box in C++?

  • #2
    Well assuming that you are using the Windows API ( which I think you were off to start learning last time ) there are 2 ( maybe more ) ways..

    Method 1 -- Use GetWindowText() -- I think this works!

    Code:
    int length = GetWindowTextLength( hwnd ) + 1;
    char buffer[ length ];
    GetWindowText( hwnd, buffer, length );
    the variable buffer now contains the text of the window....maybe ..

    Method 2-- The more correct way is to use the EM_GETLINE message--

    Code:
    char *buffer = (char*)SendMessage( hwnd, EM_GETLINE, (WPARAM)1, (LPARAM)0 );
    I'm pretty sure that those methods both work..
    Omnis mico antequam dominus Spookster!

    Comment


    • #3
      thx again

      Comment

      Working...
      X