on my label i'm trying do the autosize:
Code:
void setAutoSize(bool autosize)
    {
        long s=0;
        if (autosize==true)
        {
            char a[256];
            GetWindowText(this->hwnd,a,256);
            SIZE b;
            HDC hdc = GetDC(hwnd);
            HFONT hFont = (HFONT)SendMessage(hwnd, WM_GETFONT, 0, 0);
            HFONT hOldFont = (HFONT)SelectObject(hdc, hFont);

            GetTextExtentPoint32(hdc, a, strlen(a) ,&b);

            SelectObject(hdc, hOldFont);
            ReleaseDC(hwnd,hdc);
            RECT c;
            GetWindowRect(hwnd,&c);
            c.bottom=b.cy;
            c.right=b.cx+2;
            LONG s=GetWindowLongPtr(hwnd,GWL_EXSTYLE);
            LONG g=GetWindowLongPtr(hwnd,GWL_STYLE);
            AdjustWindowRectEx (&c,g,FALSE,s );
            SetWindowPos(hwnd, 0, 0, 0, c.right, c.bottom,
            SWP_NOZORDER|SWP_NOMOVE|SWP_NOACTIVATE|
            SWP_DRAWFRAME | SWP_FRAMECHANGED);
        }
    }
these code works fine, but if i use '\t' or '\n' with string(char*) these are ignored or considered 1 char.
so is there another way for get the HDC\bitmap\rect of the inside of the control correctly?