RECT rtWindow;
GetWindowRect(&rtWindow);
//long x = 400;
//long y = 200;
long x = rtWindow.left;
long y = rtWindow.top;
long cxWidth = rtWindow.right-rtWindow.left;
long cyHeight = rtWindow.bottom-rtWindow.top;
const long nOffset = 9;
const long SLEEP_INTERAL = 60;
for(long i=0; i<=2; ++i)
{
::MoveWindow(m_hWnd, x+nOffset, y-nOffset, cxWidth, cyHeight, TRUE);
::Sleep(SLEEP_INTERAL);
::MoveWindow(m_hWnd, x-nOffset, y-nOffset, cxWidth, cyHeight, TRUE);
::Sleep(SLEEP_INTERAL);
::MoveWindow(m_hWnd, x-nOffset, y+nOffset, cxWidth, cyHeight, TRUE);
::Sleep(SLEEP_INTERAL);
::MoveWindow(m_hWnd, x+nOffset, y+nOffset ,cxWidth, cyHeight, TRUE);
::Sleep(SLEEP_INTERAL);
::MoveWindow(m_hWnd, x, y, cxWidth, cyHeight, TRUE);
::Sleep(SLEEP_INTERAL);
}
模拟qq窗口抖动效果
最新推荐文章于 2023-03-16 18:04:17 发布
本文介绍了如何使用Windows API在循环中调整窗口的位置,通过`MoveWindow`函数实现窗口在屏幕上的四个方向移动,并在每次移动后暂停一段时间。核心代码展示了如何获取窗口矩形并进行坐标计算。

390

被折叠的 条评论
为什么被折叠?



