summaryrefslogtreecommitdiff
path: root/redo/common_windows.c
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-08-28 13:30:29 -0400
committerPietro Gagliardi <[email protected]>2014-08-28 13:30:29 -0400
commit2e4ede72cfeab117f52e572adcb9071a89ce58f2 (patch)
tree53dc2506d4acad5f0a7724eaa727a56d0118292b /redo/common_windows.c
parentd0f9c8af8acc56927b6cc7d3130a42c828b6bddb (diff)
Fixed Group child control transparency on Windows.
Diffstat (limited to 'redo/common_windows.c')
-rw-r--r--redo/common_windows.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/redo/common_windows.c b/redo/common_windows.c
index 6b6f08f..d89cb21 100644
--- a/redo/common_windows.c
+++ b/redo/common_windows.c
@@ -110,15 +110,20 @@ void paintControlBackground(HWND hwnd, HDC dc)
RECT r;
POINT p;
int saved;
+ WCHAR classname[128] = L""; // more than enough to avoid collisions
- // TODO traverse deeper if a groupbox
// TODO implement WM_PRINTCLIENT in window_windows.c
- parent = GetParent(hwnd);
- if (parent == NULL)
- xpanic("error getting parent container of control in paintControlBackground()", GetLastError());
- parent = GetParent(parent);
- if (parent == NULL)
- xpanic("error getting parent control of control in paintControlBackground()", GetLastError());
+ parent = hwnd;
+ do {
+ parent = GetParent(parent);
+ if (parent == NULL)
+ xpanic("error getting parent container of control in paintControlBackground()", GetLastError());
+ parent = GetParent(parent);
+ if (parent == NULL)
+ xpanic("error getting parent control of control in paintControlBackground()", GetLastError());
+ 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
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