How do you get the value of an edit box in C++?
Announcement
Collapse
No announcement yet.
Getting Edit Box Value
Collapse
X
-
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 );
..
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 );
Omnis mico antequam dominus Spookster!
Comment