I read the dialogs using the messages WM_CTLCOLORSTATIC, WM_CTLCOLORBTN as such: -
case WM_CTLCOLORSTATIC:
case WM_CTLCOLORBTN:
hdc = (HDC)wParam;
hwndCtl = (HWND)lParam;
SetTextColor(hdc,RGB(0xff,0xff,0xff));
SetBkMode(hdc,TRANSPARENT);
pt.x = 0;
pt.y = 0;
MapWindowPoints(hwndCtl,_hwnd,&pt,1);
x = -pt.x;
y = -pt.y;
SetBrushOrgEx(hdc,x,y,NULL);
return (INT_PTR)_skinBrush;
This code sets the text color to white for all static elements, since the background brush paints an image with low contrast.
Ive was recently updated (only) to use Common Controls 6 and XP-Themeing in my dialogs, but all the text on the "disapeared" controls was again displayed in black by default.
Is there any other way to control the text color of controls under xp-themeing? Or do I need to consider ownerdraw now :-(?
(And the ownerβs draw is really NOT an option - if I own all of my controls, all the motivation for switching to general controls 6 first disappears).
source
share