DrawAnimatedRects的功能是什麼呢認爲「Ĵ放棄「任務欄 - 不需要自己渲染窗口動畫。
編輯:除Vista無法正常工作外。下面是一些等效代碼:
// DrawAnimatedRects(wnd->GetSafeHwnd(), IDANI_CAPTION, animateFrom, &rect);
const DWORD MILLIs = 500;
DWORD startTime = GetTickCount();
DWORD now = startTime;
CRect offset(rect.left - animateFrom->left, rect.top - animateFrom->top,
rect.right - animateFrom->right, rect.bottom - animateFrom->bottom);
wnd->Invalidate();
while (now - MILLIs < startTime)
{
int fraction100 = (int) (((now - startTime) * 100)/MILLIs);
CRect step(animateFrom->left + (fraction100 * offset.left)/100,
animateFrom->top + (fraction100 * offset.top)/100,
animateFrom->right + (fraction100 * offset.right)/100,
animateFrom->bottom + (fraction100 * offset.bottom)/100);
wnd->SetWindowPos(0, step.left, step.top,
step.right - step.left, step.bottom - step.top,
SWP_NOZORDER);
wnd->ShowWindow(SW_SHOWNORMAL);
Sleep(5);
now = GetTickCount();
}
謝謝 - 看起來很有希望! – Mark 2009-06-12 22:54:16