5 TCHAR buffer[512] = {};
6 wnd.GetWindowText(buffer, _countof(buffer));
9 WIN32_OP_D( wnd.GetClientRect(contentRect) );
11 dc.SetTextColor(GetSysColor(COLOR_WINDOWTEXT));
12 dc.SetBkMode(TRANSPARENT);
15 CBrushHandle brush = (HBRUSH) wnd.GetParent().SendMessage(WM_CTLCOLORSTATIC, (WPARAM) (HDC) dc, (LPARAM) wnd.m_hWnd);
16 if (brush != NULL) dc.FillRect(contentRect, brush);
21 CRect rcText(contentRect);
22 WIN32_OP_D( dc.DrawText(buffer,txLen,rcText,DT_NOPREFIX | DT_END_ELLIPSIS | DT_SINGLELINE | DT_VCENTER | DT_LEFT ) > 0);
25 SIZE txSize, probeSize;
26 const TCHAR probe[] = _T(
"#");
27 if (dc.GetTextExtent(buffer,txLen,&txSize) && dc.GetTextExtent(probe, _countof(probe), &probeSize)) {
28 int spacing = txSize.cx > 0 ? (probeSize.cx / 4) : 0;
29 if (txSize.cx + spacing < contentRect.Width()) {
30 const CPoint center = contentRect.CenterPoint();
31 CRect rcEdge(contentRect.left + txSize.cx + spacing, center.y, contentRect.right, contentRect.bottom);
32 WIN32_OP_D( dc.DrawEdge(rcEdge, EDGE_ETCHED, BF_TOP) );
35 }
t_size strlen_max_t(const t_char *ptr, t_size max)