Calculating lenght of text in a dialog control
I am writing a program that analyses RC files and reports stuff like word
count, number of resources, and so on. I would like to implement a function
which reports clipped strings in controls (if the control is too small for
the text). Does anybody know how to calculate the size of a control so the
text will fit?
Thanks.
Re: Calculating lenght of text in a dialog control
You can use the function called ::GetTabbedTextExtent() or ::GetTextExtent() to calculate the size of the text, you must pass in a handle to a DC so that it can get the font information about the text string.