...

View Full Version : Getting Edit Box Value



trib4lmaniac
02-27-2004, 03:45 PM
How do you get the value of an edit box in C++?

Mhtml
02-28-2004, 02:26 PM
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!



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--



char *buffer = (char*)SendMessage( hwnd, EM_GETLINE, (WPARAM)1, (LPARAM)0 );


I'm pretty sure that those methods both work..

trib4lmaniac
03-03-2004, 03:33 PM
thx again :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum