[win32 api] how to set max characters allowed in an edit box?

Started by
1 comment, last by helloworld123 15 years, 11 months ago
how do you limit an edit/text box where user can type on to, say, 15 characters? I'm doing this to get the text on the edit box:

g_Username = new TCHAR[MAX_USERNAME_LEN];
GetDlgItemText(hWndDlg, IDC_USERNAME, g_Username, MAX_USERNAME_LEN);
but couldn't figure out how to limit the max. char user can type on IDC_USERNAME textbox. please help. thanks!
Advertisement
Use EM_LIMITTEXT
thanks!!

This topic is closed to new replies.

Advertisement