Dmitry Timoshkov dmitry@codeweavers.com writes:
@@ -496,7 +504,10 @@ static LRESULT StaticWndProc_common( HWN { SetWindowLongPtrW( hwnd, HFONT_GWL_OFFSET, wParam ); if (LOWORD(lParam))
STATIC_TryPaintFcn( hwnd, full_style );
{
InvalidateRect( hwnd, NULL, TRUE );
UpdateWindow( hwnd );
}
A single RedrawWindow call would be more efficient.
@@ -673,9 +684,7 @@ static void STATIC_PaintTextfn( HWND hwn if (!IsWindowEnabled(hwnd)) SetTextColor(hdc, GetSysColor(COLOR_GRAYTEXT)); }
- if (!(len = SendMessageW( hwnd, WM_GETTEXTLENGTH, 0, 0 ))) return;
- if (!(text = HeapAlloc( GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR) ))) return;
- SendMessageW( hwnd, WM_GETTEXT, len + 1, (LPARAM)text );
- if (!(len = InternalGetWindowText( hwnd, text, sizeof(text)/sizeof(WCHAR) ))) return;
You are introducing a hard-coded limit to the length of the text, that's not a good idea.