From 492845da5d3403c97c4deb85d121a131c6be87e6 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Fri, 17 Oct 2014 13:21:20 -0400 Subject: Adjusted background painting code on Windows for the new container structure. --- newctrl/common_windows.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'newctrl/common_windows.c') diff --git a/newctrl/common_windows.c b/newctrl/common_windows.c index 3f1a52e..b30b132 100644 --- a/newctrl/common_windows.c +++ b/newctrl/common_windows.c @@ -103,7 +103,7 @@ void paintControlBackground(HWND hwnd, HDC dc) WCHAR classname[128] = L""; // more than enough to avoid collisions parent = hwnd; - do { + for (;;) { parent = GetParent(parent); if (parent == NULL) xpanic("error getting parent container of control in paintControlBackground()", GetLastError()); @@ -117,7 +117,11 @@ void paintControlBackground(HWND hwnd, HDC dc) return; if (GetClassNameW(parent, classname, 128) == 0) xpanic("error getting name of focused window class in paintControlBackground()", GetLastError()); - } while (_wcsicmp(classname, L"button") == 0); // skip groupboxes + // skip container and groupboxes + if (_wcsicmp(classname, containerclass) != 0) // container + if (_wcsicmp(classname, L"button") != 0) // groupbox + break; + } if (GetWindowRect(hwnd, &r) == 0) xpanic("error getting control's window rect in paintControlBackground()", GetLastError()); // the above is a window rect; convert to client rect -- cgit v1.2.3