summaryrefslogtreecommitdiff
path: root/newctrl/common_windows.c
diff options
context:
space:
mode:
Diffstat (limited to 'newctrl/common_windows.c')
-rw-r--r--newctrl/common_windows.c8
1 files changed, 6 insertions, 2 deletions
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