开发者

Skin Dialogs when using XP Themes?

I have been skinning dialogs by using the WM_CTLCOLORSTATIC, WM_CTLCOLORBTN messages 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 as the background brush paints a low contrast image.

Ive (only) recently updated to use Common Controls 6 and the XP-Themeing look on my dialogs but all the text on controls has 'dissapeared' as its being drawn in the default black again.

Is there some other way to control the text color of controls under xp-themeing? Or do 开发者_JAVA技巧I need to consider ownerdraw now :-( ?

(And owner draw is really NOT an option - If I ownerdraw all my controls the entire motivation for switching to common controls 6 in the first place falls away).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜