Call this member function to compute the width and height of a character string using m_hAttribDC, the attribute device context.
CSize GetTabbedTextExtent( LPCTSTR lpszString, int nCount, int nTabPositions, LPINT lpnTabStopPositions ) const; CSize GetTabbedTextExtent( const CString& str, int nTabPositions, LPINT lpnTabStopPositions ) const;
If the string contains one or more tab characters, the width of the string is based upon the tab stops specified by lpnTabStopPositions. The function uses the currently selected font to compute the dimensions of the string.
The current clipping region does not offset the width and height returned by the GetTabbedTextExtent function.
Since some devices do not place characters in regular cell arrays (that is, they kern the characters), the sum of the extents of the characters in a string may not be equal to the extent of the string.
If nTabPositions is 0 and lpnTabStopPositions is NULL, tabs are expanded to eight times the average character width. If nTabPositions is 1, the tab stops will be separated by the distance specified by the first value in the array to which lpnTabStopPositions points. If lpnTabStopPositions points to more than a single value, a tab stop is set for each value in the array, up to the number specified by nTabPositions.