仅仅让黑窗口抖动以供小白娱乐

 #include<stdio.h>
#include<windows.h> int main()
{
RECT rect;//RECT定义了一个矩形结构体,存储矩形边框
HWND hwnd = NULL, oldhwnd = NULL;//窗口句柄 int x, y, width, height;
int i; system("title Hello World!");//标题:Hello World for (i = ; i < ; i++)
{
hwnd = GetForegroundWindow();//获取活动窗口的句柄 if (hwnd != oldhwnd)
{
GetWindowRect(hwnd, &rect);//获取指定窗口位置
x = rect.left;
y = rect.top;
width = rect.right - x;
height = rect.bottom - y;
oldhwnd = hwnd;//保存新获取的句柄窗口
} MoveWindow(hwnd, x - , y, width, height, TRUE);
Sleep();
MoveWindow(hwnd, x - , y-, width, height, TRUE);
Sleep();
MoveWindow(hwnd, x , y-, width, height, TRUE);
Sleep();
MoveWindow(hwnd, x , y, width, height, TRUE);
Sleep(); system("cls");//刷新缓冲区
printf("对方给您发送了一个加长版窗口抖动\n");
} return ;
}
05-11 19:28