uxtheme: Call DefDlgProc() if drawing tab body in a dialog fails.

Some third party themes have tab body part defined but with its ImageSelectType set to IST_NONE.
In this case, DrawThemeBackground() will fail to draw the background.

Fix track bar black background in winecfg when using VLT theme.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zhiyi Zhang 2021-11-30 14:50:40 +08:00 committed by Alexandre Julliard
parent bcbe1bcff3
commit 5cdbcb0f59
1 changed files with 7 additions and 8 deletions

View File

@ -38,8 +38,9 @@ LRESULT WINAPI UXTHEME_DefDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa
static const WCHAR themeClass[] = L"Window";
BOOL themingActive = IsThemeDialogTextureEnabled (hWnd);
BOOL doTheming = themingActive && (theme != NULL);
HRESULT hr = E_FAIL;
LRESULT result;
switch (msg)
{
case WM_CREATE:
@ -78,13 +79,11 @@ LRESULT WINAPI UXTHEME_DefDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa
NULL);
#endif
return user_api.pDefDlgProc(hWnd, msg, wParam, lParam, unicode);
else
/* We might have gotten a TAB theme class, so check if we can
* draw as a tab page. */
if (IsThemePartDefined (theme, TABP_BODY, 0))
DrawThemeBackground (theme, (HDC)wParam, TABP_BODY, 0, &rc,
NULL);
else
/* We might have gotten a TAB theme class, so check if we can draw as a tab page */
else if (IsThemePartDefined(theme, TABP_BODY, 0))
hr = DrawThemeBackground(theme, (HDC)wParam, TABP_BODY, 0, &rc, NULL);
if (FAILED(hr))
return user_api.pDefDlgProc(hWnd, msg, wParam, lParam, unicode);
}
return 1;