does anyone know how to get the value from an edit box?
okay, suppose you create an edit box as a child window:
(CreateWindowEx(NULL, "edit", "0 ", WS_CHILD | WS_VISIBLE | ES_LEFT, 80, 40, 40, 20, hwnd, (HMENU)NOP_ID, hinstance, NULL))
how do you get the value from such a edit box, and save it into a variable? Thanks.
"I do not have to destroy, because I do not fear."
Edited by - Mister Stewart on September 20, 2001 5:31:38 PM
It should be something like this :
Hope it helps!
const int BUFF_SIZE = 100;char buffer[BUFF_SIZE+1];HWND edit = GetDlgItem( hwnd, ID_MY_EDIT_ID_NUMBER);GetWindowText( edit, buffer, BUFF_SIZE);int finalValue = atoi(buffer);
Hope it helps!
Thanks again for the reply, but now I need to know how to (drumroll) put values from a variable into an edit box!!
I gather you use the commands SetDlgItemText and SetWindowText, but I am not too sure on how to use these commands.
"I do not have to destroy, because I do not fear."
I gather you use the commands SetDlgItemText and SetWindowText, but I am not too sure on how to use these commands.
"I do not have to destroy, because I do not fear."
Ok man, I''m f*****g drunk but this should work :
Have fun and don''t drink too much beer, that''s really bad for women...
const int BUFF_SIZE = 100;char buffer[BUFF_SIZE+1];sprintf( buffer, "%d", someValue);HWND edit = GetDlgItem( hwnd, ID_MY_EDIT_ID_NUMBER);SetWindowText( edit, buffer);
Have fun and don''t drink too much beer, that''s really bad for women...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement