🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
EDITTEXT Controls
I was just wondering if any one out there could tell me how to send and recieve text from a EDITTEXT control in a windows dialog based program. Thanks.
If you mean set and get the text from a normal text box on a Dialog Box in pure Win32 (no MFC) then here is how...
Getting text:
char Buffer[255];
GetDlgItemText(hDlg, TXT_MYTEXT, (char*)&Buffer, sizeof(Buffer));
-------------------------------------
Setting text:
SetDlgItemText(hDlg, TXT_MYTEXT, "This goes into the control");
(These both assume hDlg is the HWND of your dialog, and that TXT_MYTEXT is the resource ID of your text box)
Hope this helps
Steve Vallis
Getting text:
char Buffer[255];
GetDlgItemText(hDlg, TXT_MYTEXT, (char*)&Buffer, sizeof(Buffer));
-------------------------------------
Setting text:
SetDlgItemText(hDlg, TXT_MYTEXT, "This goes into the control");
(These both assume hDlg is the HWND of your dialog, and that TXT_MYTEXT is the resource ID of your text box)
Hope this helps
Steve Vallis
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement