That's all. Try:
SetWindowText(hwnd, buffer);
to see the content of buffer.
If you want to read in numbers you can limit the datafield to accept only numbers then convert that buffer to number with something like atol, atof.
rpeter
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What is the right way to get the contents of a text field to a var declared as char strControl[50] ?
Right now im trying to:
char EditValue[50];
char banana;
SendMessage(hWndEditControl1, WM_GETTEXT, 49, banana);
sprintf(EditValue, "%d", banana);
But the var is storing wrong values like if the text field has the value 1234abcd in the screen, the variable gets the value -92 !?
char buffer[51];
GetDlgItemText(hwnd, IDC_DFXXX, buffer, 50);
That's all. Try:
SetWindowText(hwnd, buffer);
to see the content of buffer.
If you want to read in numbers you can limit the datafield to accept only numbers then convert that buffer to number with something like atol, atof.
rpeter
could use that but if the Window it actually a main window that command could casue some runtime errors
try using
int len = GetWindowTextLenght(hwnd,IDC_BOX);
banana = SendMessage(hwnd, WM_GETTEXT,len ,0);