Commit 4946623d authored by Frank Richter's avatar Frank Richter Committed by Alexandre Julliard

Add WM_CTLCOLORSTATIC handler to dialog theming subclass so static

text can appear transparent (for e.g. tab pages which commonly have a "fancy" background).
parent 50a9b782
...@@ -101,6 +101,39 @@ LRESULT CALLBACK THEMING_DialogSubclassProc (HWND hWnd, UINT msg, ...@@ -101,6 +101,39 @@ LRESULT CALLBACK THEMING_DialogSubclassProc (HWND hWnd, UINT msg,
return 1; return 1;
} }
case WM_CTLCOLORSTATIC:
if (!doTheming) return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
{
DLGPROC dlgp = (DLGPROC)GetWindowLongPtrW (hWnd, DWLP_DLGPROC);
LRESULT result = (LRESULT)dlgp (hWnd, msg, wParam, lParam);
if (!result)
{
/* Override defaults with more suitable values when themed */
HDC controlDC = (HDC)wParam;
HWND controlWnd = (HWND)lParam;
WCHAR controlClass[32];
RECT rc;
GetClassNameW (controlWnd, controlClass,
sizeof(controlClass) / sizeof(controlClass[0]));
if (lstrcmpiW (controlClass, WC_STATICW) == 0)
{
/* Static control - draw parent background and set text to
* transparent, so it looks right on tab pages. */
GetClientRect (controlWnd, &rc);
DrawThemeParentBackground (controlWnd, controlDC, &rc);
SetBkMode (controlDC, TRANSPARENT);
/* Return NULL brush since we painted the BG already */
return (LRESULT)GetStockObject (NULL_BRUSH);
}
else
return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
}
return result;
}
default: default:
/* Call old proc */ /* Call old proc */
return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam); return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment