[API]
DrawTextW
DrawTextA
RECT

[CODE]
Public Function DrawTextGetHeight(ByVal hDC As Long, ByVal xText As String, ByVal xMode As Long) As Long
  Dim xLong1 As Long
  Dim xType1 As RECT
  
  xType1.Right = &H1FFF&
  xType1.Bottom = &H1FFF&
  
  xLong1 = Len(xText)
  If IsUnicode Then
    Call DrawTextW(hDC, StrPtr(xText), xLong1, xType1, xMode Or &H400&)
    Else
    Call DrawTextA(hDC, xText, xLong1, xType1, xMode Or &H400&)
    End If
  DrawTextGetHeight = xType1.Bottom
  End Function
