void CBarDrawButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) 
{
CDC* pDC=CDC::FromHandle(lpDrawItemStruct->hDC);
CRect rect=lpDrawItemStruct->rcItem;
//Draw the back ground with dark color
pDC->FillSolidRect(rect,RGB(69,117,188));
//if the bitmap file name has not been loaded
if(!bFileLoaded) return;
//Draw the bitmap
if(bSelected)
{
ShowBitmap.SetBitmapFileName(csSelectedFileName);
ShowBitmap.DrawBitmap(pDC);
}
else
{
ShowBitmap.SetBitmapFileName(csNormalFileName);
ShowBitmap.DrawBitmap(pDC);
}
//Release the DC
ReleaseDC(pDC);
}void CBarDrawButton::OnMouseMove(UINT nFlags, CPoint point) 
{
CRect rect;
CDC* pDC=GetDC();
//If the bitmap file has been loaded
if(bFileLoaded)
{
//Get the client rectangle
GetClientRect(&rect);
if(!bEntered)//When mouse moving over the button
{
bEntered=true;
ShowBitmap.SetBitmapFileName(csOverFileName);
ShowBitmap.DrawBitmap(pDC);
//Track the mouse till it leaves the button
SetCapture();
}
else if(!rect.PtInRect(point)) //When the mouse leaves the button
{
bEntered=false;
ShowBitmap.SetBitmapFileName(csNormalFileName);
ShowBitmap.DrawBitmap(pDC);
//Release track the mouse
ReleaseCapture();
}
//Release the DC device
ReleaseDC(pDC);
}
CButton::OnMouseMove(nFlags, point);
}//////////////////////////////////////////////////////////////////////////
when the LButton click, why the OnMouseMove get invalidate?