Today, I want to be a self-draw button. The previous self-drawing button is derived from CWND, handling Click events, draws in wm_pain. Today, from CButton, it is also drawn in WM_Paint, and I can't. One click, there is a lack of lacking The like of the provincial button is not movable.
Take a look at the documentation, I found to use the BS_OWNERDRAW style to overrun DRAWITEM. You can draw it casually.
Delicate your own buttons from CButton, to deal with the mouse event from CWND, different yourself, and you can process Checkbox, Radiobutton.
There is no status of mouse_hover in DrawItemStruct, which is the state of the mouse on the button, but according to the "how to determine the mouse in the window" according to the previous article "can easily realize the status of the mouse to enter the button.