Click to See Complete Forum and Search --> : Calculating lenght of text in a dialog control


April 13th, 1999, 02:54 PM
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.

SKB
April 13th, 1999, 03:33 PM
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.