Maybe the thing you want is
DrawText? There are some nice Flags. Have a look (I'm sorry, only VB declarations, but I'm sure you'll manage):
Code:
Declare Function DrawText Lib "user32" Alias "DrawTextA" _
(ByVal hdc As Long, ByVal lpStr As String, ByVal nCount As Long, _
lpRect As RECT, ByVal wFormat As Long) As Long
· uFormat
Specifies the method of formatting the text. It can be any combination of the following
[.. snip ..]
DT_CALCRECT
Determines the width and height of the rectangle. If there are multiple
lines of text, DrawText uses the width of the rectangle pointed to by the
lpRect parameter and extends the base of the rectangle to bound the
last line of text. If there is only one line of text, DrawText modifies the right
side of the rectangle so that it bounds the last character in the line. In either
case, DrawText returns the height of the formatted text but does not draw the text.
Maybe that's what you need? It might be worth a try, for speed reasons... No idea though...