|
void CPNGButton::OnLButtonDown(UINT nFlags, CPoint point)
{
SetCapture();
SetPNG2Button(m_strMouseDownImagePath);
CStatic::OnLButtonDown(nFlags, point);
}
void CPNGButton::OnLButtonUp(UINT nFlags, CPoint point)
{
SetPNG2Button(m_strMouseMoveImagePath);
CStatic::OnLButtonUp(nFlags, point);
}
void CPNGButton::OnMouseMove(UINT nFlags, CPoint point)
{
SetCapture();
CRect rc;
GetClientRect(rc);
if (rc.PtInRect(point))
{
if (!m_isPointInWnd)
{
OnMouseEnter();
m_isPointInWnd = TRUE;
}
}
else
{
SetPNG2Button(m_strMouseAwayImagePath);
ReleaseCapture();
m_isPointInWnd = FALSE;
}
CStatic::OnMouseMove(nFlags, point);
}
void CPNGButton::OnMouseEnter()
{
SetPNG2Button(m_strMouseMoveImagePath);
}
I create a CPNGButton class to display a button. Using three images to display three different status. No mouse, mouse move, L Button down. CPNGButton is a child class of CStatic. Now if this CPNGButton button is a Minize button, when click this button. After restore the MainFrame, how to restore the minimize button status. Just to how to capture the mouse away from this minimize button?
|
|
|
|