VC6.0控制窗口抖动
DWORD WINAPI move(LPVOID lpParameter)
{
int cou=0;
int nCxFrame = ::GetSystemMetrics(SM_CXSIZEFRAME);
int nCyFrame = ::GetSystemMetrics(SM_CYSIZEFRAME);
int nCyCaption = ::GetSystemMetrics(SM_CYCAPTION);
int nWidth = rt.right - rt.left;
int nHeight = rt.bottom - rt.top;
POINT pt;
pt.x = pt.y = 0;
pt.x = pt.x - nCxFrame + 1;
pt.y = pt.y - nCyFrame - nCyCaption + 1;
::ClientToScreen(hwnd, &pt);
while(movewin)
{
for(cou=0;cou<=30;cou++)
{
MoveWindow(hwnd,pt.x, pt.y, nWidth, nHeight,true);
UpdateWindow(hwnd);
Sleep(30);
MoveWindow(hwnd,pt.x - 2, pt.y + 2, nWidth, nHeight,true);
UpdateWindow(hwnd);
Sleep(30);
MoveWindow(hwnd,pt.x + 2, pt.y - 2, nWidth, nHeight,true);
UpdateWindow(hwnd);
Sleep(30);
}
}
MoveWindow(hwnd,pt.x, pt.y, nWidth, nHeight,true);
return true;
}