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