- if ( !s.IsEmpty() )
- {
- int existingExtent = (int)SendMessage(GetHwnd(), LB_GETHORIZONTALEXTENT, 0, 0L);
- HDC dc = GetWindowDC(GetHwnd());
- HFONT oldFont = 0;
- if (GetFont().Ok() && GetFont().GetResourceHandle())
- oldFont = (HFONT) ::SelectObject(dc, (HFONT) GetFont().GetResourceHandle());
-
- GetTextMetrics(dc, &lpTextMetric);
- SIZE extentXY;
- ::GetTextExtentPoint(dc, (LPTSTR) (const wxChar *)s, s.Length(), &extentXY);
- int extentX = (int)(extentXY.cx + lpTextMetric.tmAveCharWidth);