|
-
June 21st, 2005, 01:04 PM
#1
How to retrieve a name associated with Edit Box
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.
-
June 21st, 2005, 01:22 PM
#2
Re: How to retrieve a name associated with Edit Box
If hDlg is a handle to your dialog and IDC_EDIT1 is the identifier of your edit control (textbox), then this code should work:
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));
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.
Last edited by Bond; June 21st, 2005 at 01:24 PM.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|