case WM_MOUSEMOVE: //鼠标移动事件
{
pt.x = LOWORD(lParam); //鼠标按下的横坐标
pt.y = HIWORD(lParam); //鼠标按下的纵坐标
if (pButton->m_Style>0)
return pButton->OnMouseMove(hWnd,0, pt);
else
return CallWindowProc(pButton->m_OldProc, hWnd,Msg,wParam,lParam);
break;
}
case WM_DESTROY: //销毁窗口
{
WNDPROC procOld=pButton->m_OldProc;
SetWindowLong(hWnd,GWL_WNDPROC,(long)procOld); //恢复原来的窗口函数
CWnd* pWnd = ::CWnd::FromHandle(hWnd); //将按钮对象与控制块分离
if (pWnd)
{
pWnd->Detach();
}
pButton->m_Flag = 1;
return 1;
}
default :
{
break;
}
}
return CallWindowProc(pButton->m_OldProc, hWnd, Msg, wParam, lParam );