diff --git a/dll/win32/comctl32/static.c b/dll/win32/comctl32/static.c index b4e240ad91a..1d2e39f84ee 100644 --- a/dll/win32/comctl32/static.c +++ b/dll/win32/comctl32/static.c @@ -533,6 +533,15 @@ static void STATIC_PaintOwnerDrawfn( HWND hwnd, HDC hdc, DWORD style ) if (font) SelectObject( hdc, oldFont ); } +static BOOL CALLBACK STATIC_DrawTextCallback(HDC hdc, LPARAM lp, WPARAM wp, int cx, int cy) +{ + RECT rc; + + SetRect(&rc, 0, 0, cx, cy); + DrawTextW(hdc, (LPCWSTR)lp, -1, &rc, (UINT)wp); + return TRUE; +} + static void STATIC_PaintTextfn( HWND hwnd, HDC hdc, DWORD style ) { RECT rc; @@ -626,7 +635,14 @@ static void STATIC_PaintTextfn( HWND hwnd, HDC hdc, DWORD style ) } else { - DrawTextW( hdc, text, -1, &rc, format ); + UINT flags = DST_COMPLEX; + if (style & WS_DISABLED) + flags |= DSS_DISABLED; + DrawStateW(hdc, hBrush, STATIC_DrawTextCallback, + (LPARAM)text, (WPARAM)format, + rc.left, rc.top, + rc.right - rc.left, rc.bottom - rc.top, + flags); } no_TextOut: diff --git a/win32ss/user/user32/controls/static.c b/win32ss/user/user32/controls/static.c index 3ae50684b6f..485ba82ab1a 100644 --- a/win32ss/user/user32/controls/static.c +++ b/win32ss/user/user32/controls/static.c @@ -611,6 +611,15 @@ static void STATIC_PaintOwnerDrawfn( HWND hwnd, HDC hdc, DWORD style ) if (font) SelectObject( hdc, oldFont ); } +static BOOL CALLBACK STATIC_DrawTextCallback(HDC hdc, LPARAM lp, WPARAM wp, int cx, int cy) +{ + RECT rc; + + SetRect(&rc, 0, 0, cx, cy); + DrawTextW(hdc, (LPCWSTR)lp, -1, &rc, (UINT)wp); + return TRUE; +} + static void STATIC_PaintTextfn( HWND hwnd, HDC hdc, DWORD style ) { RECT rc; @@ -706,7 +715,14 @@ static void STATIC_PaintTextfn( HWND hwnd, HDC hdc, DWORD style ) } else { - DrawTextW( hdc, text, -1, &rc, format ); + UINT flags = DST_COMPLEX; + if (style & WS_DISABLED) + flags |= DSS_DISABLED; + DrawStateW(hdc, hBrush, STATIC_DrawTextCallback, + (LPARAM)text, (WPARAM)format, + rc.left, rc.top, + rc.right - rc.left, rc.bottom - rc.top, + flags); } no_TextOut: