The GetTextMetrics function fills the specified buffer with the metrics for the currently selected font.
BOOL GetTextMetrics(
HDC hdc, // handle to device context
LPTEXTMETRIC lptm // pointer to text metrics structure
);
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
Windows NT: To get extended error information, call GetLastError.
Windows CE: For any given font, the text metric values in Windows CE will not necessarily match the text metric values in Windows desktop platforms.
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Requires version 1.0 or later.
Header: Declared in wingdi.h.
Import Library: Use gdi32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT.
Fonts and Text Overview, Font and Text Functions, GetTextAlign, GetTextExtentPoint32, GetTextFace, SetTextJustification, TEXTMETRIC