#include <windows.h>
#include <tchar.h>
#include <stdio.h>
VOID JitterWindow(HWND hwnd)
{
RECT rect;
int cxWidth, cyHeight, iIdx;
if (!IsWindow(hwnd))return;
GetWindowRect(hwnd, &rect);
cxWidth = rect.right-rect.left;
cyHeight = rect.bottom-rect.top;
for(iIdx = 0; iIdx <= 1000; iIdx += 100)
{
MoveWindow(hwnd, rect.left-50, rect.top, cxWidth, cyHeight, TRUE);
Sleep(100);
MoveWindow(hwnd, rect.left-50, rect.top + 50, cxWidth, cyHeight, TRUE);
Sleep(100);
MoveWindow(hwnd, rect.left, rect.top + 50, cxWidth, cyHeight, TRUE);
Sleep(100);
MoveWindow(hwnd, rect.left, rect.top, cxWidth, cyHeight, TRUE);
Sleep(100);
}
return;
}
int main()
{
JitterWindow(GetForegroundWindow());
getchar();
getchar();
return 0;
}
窗口抖动
最新推荐文章于 2019-01-08 23:04:04 发布