做2种按钮,WM_SETFOCUS 时LOAD一种,WM_KILLFOCUS时LOAD另一种

解决方案 »

  1.   

    case WM_CTLCOLOR:
             {
                // Set foreground and background colors only if this
                // is an edit control.
                if (HIWORD(lParam) == CTLCOLOR_BTN)
                {
                   // Set the edit control's foreground text color to
                   // cyan and the text's background color to blue.
                   SetTextColor(wParam, RGB(0, 255, 255));
                   SetBkColor(wParam, RGB(0, 0, 255));---------------------
    你可以查这篇文章,告诉你WM_CTLCOLORBTN不行为什么INFO: WM_CTLCOLORxxx Message Changes Q130952
    http://support.microsoft.com/default.aspx?scid=kb;en-us;Q130952
      

  2.   

    To zhuwenzheng()
     若干个窗口、N多按钮,SDK中这样做实在太累了To strip(阿飞)
     刚测了一下:捕捉不到WM_CTLCOLOR消息,但WM_CTLCOLORBTN可以跟到
      

  3.   

    SDK 中你可以子类化(或者超类化)一个按钮,
      

  4.   

    我觉得owner+DRAWITEM一点也不麻烦呀?重载个函数,加两句代码就可以了
    别的方法我看比这个也简单不了多少