void CSkinButton2::OnMouseMove(UINT nFlags, CPoint point) { if(m_bUseResponseRect && !m_rcResponse.PtInRect(point)) { //CButton::OnMouseMove(nFlags, point); SendMouseMessageToParent(WM_MOUSEMOVE, nFlags, point); return; } if( !m_bSelected && IsWindowEnabled()&&m_bHandMouse ) { #ifndef IDC_HAND #define IDC_HAND MAKEINTRESOURCE(32649) #endif ::SetCursor(::LoadCursor(NULL, IDC_HAND)); } if (!m_bMouseOnButton) { TRACKMOUSEEVENT tme; tme.cbSize = sizeof(tme); tme.hwndTrack = m_hWnd; tme.dwFlags = TME_LEAVE | TME_HOVER; tme.dwHoverTime = 1; m_bMouseOnButton = _TrackMouseEvent(&tme); } CButton::OnMouseMove(nFlags, point); }
void CSkinButton2::OnLButtonDown(UINT nFlags, CPoint point) { // TODO: 在此添加消息处理程序代码和/或调用默认值 if(m_bUseResponseRect && !m_rcResponse.PtInRect(point)) { //CButton::OnMouseMove(nFlags, point); SendMouseMessageToParent(WM_LBUTTONDOWN, nFlags, point); return; } if( m_bSelected ) { this->SetCapture(); return ; } m_bMouseDown = TRUE; CButton::OnLButtonDown(nFlags, point); }
void CSkinButton2::OnLButtonUp(UINT nFlags, CPoint point) { // TODO: 在此添加消息处理程序代码和/或调用默认值 if(m_bUseResponseRect && !m_rcResponse.PtInRect(point)) { //CButton::OnMouseMove(nFlags, point); ::ReleaseCapture(); SendMouseMessageToParent(WM_LBUTTONUP, nFlags, point); return; } if( m_bSelected ) { ::ReleaseCapture(); return ; } m_bMouseDown = FALSE; CButton::OnLButtonUp(nFlags, point); }
void SolidRectWnd::OnLButtonDown(UINT nFlags, CPoint point) { SendMouseMessageToParent(WM_LBUTTONDOWN, nFlags, point); CWnd::OnLButtonDown(nFlags, point); }
void SolidRectWnd::OnMouseMove(UINT nFlags, CPoint point) { SendMouseMessageToParent(WM_MOUSEMOVE, nFlags, point); CWnd::OnMouseMove(nFlags, point); }
void SolidRectWnd::OnRButtonUp(UINT nFlags, CPoint point) { SendMouseMessageToParent(WM_RBUTTONUP, nFlags, point); CWnd::OnRButtonUp(nFlags, point); }