#include<iostream>
#include<windows.h>
using namespace std;
int main(){
int iDesktopWidth = GetSystemMetrics(SM_CXSCREEN);
int iDesktopHeight = GetSystemMetrics(SM_CYSCREEN);
HWND hDesktop = GetDesktopWindow();
HDC hdc = GetWindowDC(hDesktop);
while(true){
int x=GetSystemMetrics(SM_CXSCREEN);
Beep(999999,2000);//Beep里第一个是声音大小,第二个是什么声音[滑稽]
Beep(999999,1000);
int y=GetSystemMetrics(SM_CYSCREEN);
SetCursorPos(rand()%x,rand()%y);
POINT cursor;
GetCursorPos(&cursor);
DrawIcon(hdc, cursor.x - 10, cursor.y - 10, LoadIcon(NULL, IDI_ERROR));
}
}
等级:下下
这个网络传播了解的还少,最近研究研究。