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.
------------------------------"My sword is like a menacing cloud, but instead of rain, blood will pour in its path." - Sehabeddin, Turkish Military Commander 1438.
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
Recommended Tutorials
Advertisement