睡觉口干舌燥是糖尿病:InvalidateRect(NULL) 在程序段中的作用

来源:百度文库 编辑:查人人中国名人网 时间:2024/04/27 20:35:58
void CLinkButton::OnTimer(UINT nIDEvent)
{
static bool pPainted = false;
POINT pt;
GetCursorPos(&pt);
CRect rect;
GetWindowRect (rect);
if (bLBtnDown)
{
KillTimer (1);
if (pPainted) InvalidateRect (NULL);
pPainted = FALSE;
return;
}

if (!rect.PtInRect (pt))
{
bHighlight = false;
KillTimer (1);

if (pPainted)
InvalidateRect(NULL);

pPainted = false;
return;
}
else
{
bHighlight = true;
if (!pPainted)
{
pPainted = true;
InvalidateRect(NULL);
}
}

CButton::OnTimer(nIDEvent);
}

InvalidateRect是将指定的矩形区域加入刷新区域,如果矩形区域参数为NULL,则将全部窗口区域加入刷新区域。