-
String from a text box
I want to get a string from a text box with GetDlgItmText() (I think this is the function). One of the parameters is the number of characters to get from the textbox. Well, the thing is, I don't know how many characters there are going to be. I just want to get all of the characters from the text box, not a limited amount. And, how would you know once it is the end of the string from a text box? Would there be the esc char ('\0')? Otherwise, how could you tell? Thanks.
-
The amount of chars in this function relates to the Maximum. If you set it at 500, and the used types 50. You will be OK.
The buffer is NULL terminated. The return from this func is an int that tells you the actual amount retreaved
-
There's no other way to get an inexact number of characters? This text box is not going to be a measily 50 chars.
-
Call GetWindowTextLength() to get the size of the text. Allocate your buffer, then call GetWindowText to retrieve the text.
-
Thanks, that exactly what I need!