Hello,
I want to know how you can retrieve a name associated with Edit Box.
I did some research and found the function getDlgItemText() but don;t
know how to use it.
Thanks.
Printable View
Hello,
I want to know how you can retrieve a name associated with Edit Box.
I did some research and found the function getDlgItemText() but don;t
know how to use it.
Thanks.
If hDlg is a handle to your dialog and IDC_EDIT1 is the identifier of your edit control (textbox), then this code should work:
If you want to get fancier, you can use WM_GETTEXTLENGTH to retrieve the length of the text stored in the edit control and then dynamically create a buffer of this size ( + 1 for the terminating NULL character ) to store the result.Code:// Create a buffer to hold the text...
TCHAR szText[64];
// Call the function to retrieve the text from the edit control...
GetDlgItemText(hDlg, IDC_EDIT1, szText, sizeof(szText));