From d4245a448da133eaab29e0337bf811b932bde4e1 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 4 May 2015 20:36:33 -0400 Subject: [PATCH] Moved the WM_CTLCOLORxxx handler back into the Windows uiContainer. --- windows/OLDcontainer.c | 12 +----------- windows/container.c | 11 +++++++++++ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/windows/OLDcontainer.c b/windows/OLDcontainer.c index 60904a45..18c4a19d 100644 --- a/windows/OLDcontainer.c +++ b/windows/OLDcontainer.c @@ -63,17 +63,7 @@ static LRESULT CALLBACK parentWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARA // these must always be executed, even on the initial parent // why? http://blogs.msdn.com/b/oldnewthing/archive/2010/03/16/9979112.aspx switch (uMsg) { - case WM_CTLCOLORSTATIC: - case WM_CTLCOLORBTN: -/*TODO // read-only TextFields and Textboxes are exempt - // this is because read-only edit controls count under WM_CTLCOLORSTATIC - if (windowClassOf((HWND) lParam, L"edit", NULL) == 0) - if (textfieldReadOnly((HWND) lParam)) - return DefWindowProcW(hwnd, uMsg, wParam, lParam); -*/ if (SetBkMode((HDC) wParam, TRANSPARENT) == 0) - logLastError("error setting transparent background mode to controls in parentWndProc()"); - paintControlBackground((HWND) lParam, (HDC) wParam); - return (LRESULT) hollowBrush; + } // these are only executed on actual parents diff --git a/windows/container.c b/windows/container.c index 2536124e..20a1390a 100644 --- a/windows/container.c +++ b/windows/container.c @@ -90,6 +90,17 @@ static LRESULT CALLBACK containerWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LP if (control != NULL && IsChild(initialParent, control) == 0) return SendMessageW(control, msgNOTIFY, wParam, lParam); break; + case WM_CTLCOLORSTATIC: + case WM_CTLCOLORBTN: +/*TODO // read-only TextFields and Textboxes are exempt + // this is because read-only edit controls count under WM_CTLCOLORSTATIC + if (windowClassOf((HWND) lParam, L"edit", NULL) == 0) + if (textfieldReadOnly((HWND) lParam)) + return DefWindowProcW(hwnd, uMsg, wParam, lParam); +*/ if (SetBkMode((HDC) wParam, TRANSPARENT) == 0) + logLastError("error setting transparent background mode to controls in parentWndProc()"); +// paintControlBackground((HWND) lParam, (HDC) wParam); + return (LRESULT) hollowBrush; // these are only run if c is not NULL case WM_WINDOWPOSCHANGED: