鼠标移动到按钮内与按钮外消息

void CInspectButton::OnMouseMove(UINT nFlags, CPoint point)
{
if (!m_bGroup && m_Style == 0)
{
m_Style = 1;
Invalidate();  
TRACKMOUSEEVENT tme;
tme.cbSize = sizeof( TRACKMOUSEEVENT );
tme.dwFlags = TME_LEAVE;
tme.hwndTrack = m_hWnd;
tme.dwHoverTime = 0;
::TrackMouseEvent( &tme );

}
CButton::OnMouseMove(nFlags, point);
}

void CInspectButton::OnMouseLeave()
{
m_Style = 0;
Invalidate();  
CButton::OnMouseLeave();
}

你可能感兴趣的:(鼠标移动到按钮内与按钮外消息)