   subclassing
  subclasing is just replacing a window proc with another,isn't it?there are some subclassing way:1.derived a win class (class myButton :CButton) in mfc.2.use SubclassWindow()3.directly use SetWindowLong()any other way?   
  Yes, subclassing is just replacing the window proc. It's a little like using virtual functions. When you subclass a window, you only handle a few messages (usually), and then you just call the base window's window proc (Using CallWindowProc(), never call it directly or Bad Things will happen).The only real way to do it is with SetWindowLong(). MFC provides SubclassWindow() which just wraps that behaviour. If you're using MFC, by all means use SubclassWindow().   