前不久我开发一个Win32(不是MFC)程序,有两个PUSHBUTTON按钮,我希望更改着两个按钮标题的颜色,拜托高手帮我解决这个问题,万分感谢!!!

解决方案 »

  1.   

    GetWindowLong  GWL_WNDPROC得到按钮的消息处理函数
    自己定一个消息处理函数
    SetWindowLong把按钮的消息处理函数改成你自己的
    当WM_PAINT时写你自己的东东
    SetTextColor
    DrawTextelse
    调用CallWindowProc来使用原来默认的函数
      

  2.   

    在按钮上绘图吧
    自己写一个按钮类:CButton
    然后重载鼠标单击等一系列函数
    在相应函数里改变按钮的位图
      

  3.   

    The WM_CTLCOLORBTN message is sent to the parent window of a button when the button is about to be drawn. By responding to this message, the parent window can set a button's text and background colors.