恐怕不能,这个函数是根据你给定的rect来动态判断输出几行的,和你传进去的rect有关。不过,如果你指定了
DT_CALCRECT Determines the width and height of the rectangle. If there are multiple lines of text, DrawText will use the width of the rectangle pointed to by lpRect and extend the base of the rectangle to bound the last line of text. If there is only one line of text, DrawText will modify 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.
这样,就可以根据给定的宽度计算出来有多高